--- FreeBSD/tinderbox/webui/core/TinderboxDS.php 2007/11/09 22:47:22 1.1.1.1.2.1 +++ FreeBSD/tinderbox/webui/core/TinderboxDS.php 2007/11/13 07:52:29 1.1.1.1.2.2 @@ -24,7 +24,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Paefchen$ +# $Paefchen: FreeBSD/tinderbox/webui/core/TinderboxDS.php,v 1.1.1.1.2.1 2007/11/09 22:47:22 as Exp $ # $MCom: portstools/tinderbox/webui/core/TinderboxDS.php,v 1.36 2007/10/13 02:28:47 ade Exp $ # @@ -33,7 +33,7 @@ require_once 'inc_ds.php'; require_once 'inc_tinderbox.php'; class TinderboxDS { - private $this->objectMap = array( + private $objectMap = array( 'Build' => 'builds', 'BuildPortsQueue' => 'build_ports_queue', 'Config' => 'config', @@ -120,7 +120,7 @@ class TinderboxDS { AND bp.port_id = %d', $portid); - return $this->_doQueryHashRef($query, $results, array())) + return $this->_doQueryHashRef($query, $results, array()) ? $this->_newFromArray('Port', $results) : null; } @@ -460,8 +460,8 @@ class TinderboxDS { $query .= ' ORDER BY bp.last_built DESC'; return $this->_doQueryHashRef($query, $results, array()) - : $this->_newFromArray('Port', $results) - ? null + ? $this->_newFromArray('Port', $results) + : null; } public function getBuildStatsWithStatus($build_id) { @@ -471,7 +471,7 @@ class TinderboxDS { WHERE build_id = ? GROUP BY last_status'; - return $this->_doQueryHashRef($query, $results, $build_id)) + return $this->_doQueryHashRef($query, $results, $build_id) ? $results : null; } @@ -484,7 +484,7 @@ class TinderboxDS { WHERE last_status = \'FAIL\' AND build_id = ?'; - return $this->_doQueryHashRef($query, $results, $build_id); + return $this->_doQueryHashRef($query, $results, $build_id) ? $results[0] : null; } @@ -547,7 +547,7 @@ class TinderboxDS { $condition = implode(' OR ', $conds); - $query = empty($condition)) + $query = empty($condition) ? "SELECT * FROM $table" : "SELECT * FROM $table WHERE $condition"; @@ -701,7 +701,7 @@ class TinderboxDS { } private function _doQueryHashRef($query, &$results, $params = array()) { - if (! $this->_doQuery($query, $params, $res)) + if (! $this->_doQuery($query, $params, $res)) { $results = null; return 0; } @@ -723,7 +723,7 @@ class TinderboxDS { return 0; } - $_res = count($params)) + $_res = count($params) ? $this->db->execute($sth, $params) : $this->db->execute($sth);