From a0b3742758e065e2e697c0ac33ba2dae5c27145e Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 10 Sep 2012 11:49:56 -0400 Subject: [PATCH] cc-4347: resizeShow pdo'd --- .../application/models/ShowInstance.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index 03a4d60a2..825516ea6 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -324,11 +324,6 @@ SQL; 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) { $con = Propel::getConnection(); @@ -372,9 +367,17 @@ SQL; //must update length of all rebroadcast instances. if ($this->isRecorded()) { - $sql = "UPDATE cc_show_instances SET ends = (ends + interval '{$deltaDay} days' + interval '{$hours}:{$mins}') - WHERE rebroadcast = 1 AND instance_id = {$this->_instanceId}"; - $con->exec($sql); + $sql = << "$deltaDay days", + ':interval' => "$hours:$mins", + ':instanceId' => $this->_instanceId ), 'execute'); + } $this->setShowEnd($new_ends);