From 2a00e58610db78881e593a176edc8d8a4535492e Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 7 Sep 2012 11:58:57 -0400 Subject: [PATCH] cc-4347: PDO like a boss. --- airtime_mvc/application/models/Show.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 293178d36..0fa4fb3cc 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -419,17 +419,20 @@ SQL; */ public function getRebroadcastsAbsolute() { - $con = Propel::getConnection(); + $sql = <<getId(); - - $sql = "SELECT starts FROM cc_show_instances " - ."WHERE instance_id = (SELECT id FROM cc_show_instances WHERE show_id = $showId ORDER BY starts LIMIT 1) AND rebroadcast = 1 " - ."ORDER BY starts"; - - //Logging::info($sql); - - $rebroadcasts = $con->query($sql)->fetchAll(); + $rebroadcasts = Application_Common_Database::prepareAndExecute( $sql, + array( 'showId' => $this->getId() ), 'all' ); $rebroadcastsLocal = array(); //get each rebroadcast show in cc_show_instances, convert to current timezone to get start date/time.