Formatted Block.php

This commit is contained in:
Rudi Grinberg 2012-09-12 11:35:28 -04:00
parent 7b41d94352
commit d69391d2dd

View file

@ -337,10 +337,12 @@ EOT;
// this function returns sum of all track length under this block. // this function returns sum of all track length under this block.
public function getStaticLength() public function getStaticLength()
{ {
$sql = "SELECT SUM(cliplength) as length FROM cc_blockcontents WHERE block_id = :block_id"; $sql = <<<SQL
SELECT SUM(cliplength) AS LENGTH
FROM cc_blockcontents
WHERE block_id = :block_id
SQL;
$result = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id), 'all', PDO::FETCH_NUM); $result = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id), 'all', PDO::FETCH_NUM);
//Logging::info($result);
return $result[0][0]; return $result[0][0];
} }
@ -1052,11 +1054,7 @@ EOT;
public function hasItemLimit() public function hasItemLimit()
{ {
list($value, $modifier) = $this->getLimitValueAndModifier(); list($value, $modifier) = $this->getLimitValueAndModifier();
if ($modifier == 'items') { return ($modifier == 'items');
return true;
} else {
return false;
}
} }
public function storeCriteriaIntoDb($p_criteriaData) public function storeCriteriaIntoDb($p_criteriaData)