From 727769b3761b8c834263f4c0ba404c981790d180 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 7 Sep 2012 12:18:13 -0400 Subject: [PATCH] cc-4347: PDO getRepeatingDate() --- airtime_mvc/application/models/Show.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 0323ac330..56ef05405 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -528,15 +528,18 @@ SQL; */ public function getRepeatingEndDate() { - $con = Propel::getConnection(); + $sql = <<getId(); - $sql = "SELECT last_show FROM cc_show_days" - ." WHERE show_id = $showId" - ." ORDER BY last_show DESC"; - - $query = $con->query($sql)->fetchColumn(0); + $query = Application_Common_Database::prepareAndExecute( $sql, + array( 'showId' => $this->getId() ), 'column' ); + /* TODO: Why return empty string instead of false? very confusing --RG + */ return ($query !== false) ? $query : ""; }