cc-4347: resizeShow pdo'd

This commit is contained in:
Rudi Grinberg 2012-09-10 11:49:56 -04:00
parent 3df4c8d65a
commit a0b3742758
1 changed files with 11 additions and 8 deletions

View File

@ -324,11 +324,6 @@ SQL;
Application_Model_RabbitMq::PushSchedule(); Application_Model_RabbitMq::PushSchedule();
} }
/*
* FUNCTION SHOULD NOT BE CALLED
* - we are removing ability to resize just a single show instance
* -please use the resize method on the Show.php class.
*/
public function resizeShow($deltaDay, $deltaMin) public function resizeShow($deltaDay, $deltaMin)
{ {
$con = Propel::getConnection(); $con = Propel::getConnection();
@ -372,9 +367,17 @@ SQL;
//must update length of all rebroadcast instances. //must update length of all rebroadcast instances.
if ($this->isRecorded()) { if ($this->isRecorded()) {
$sql = "UPDATE cc_show_instances SET ends = (ends + interval '{$deltaDay} days' + interval '{$hours}:{$mins}') $sql = <<<SQL
WHERE rebroadcast = 1 AND instance_id = {$this->_instanceId}"; UPDATE cc_show_instances
$con->exec($sql); SET ends = (ends + interval :deltaDays + interval :interval)
WHERE rebroadcast = 1
AND instance_id = :instanceId;
SQL;
Application_Common_Database::prepareAndExecute( $sql, array(
':deltaDays' => "$deltaDay days",
':interval' => "$hours:$mins",
':instanceId' => $this->_instanceId ), 'execute');
} }
$this->setShowEnd($new_ends); $this->setShowEnd($new_ends);