cc-4347: PDO'd deleteAllRebroadcasts()

This commit is contained in:
Rudi Grinberg 2012-09-07 12:29:42 -04:00
parent ad776ff8f3
commit efb35dd9d6
1 changed files with 10 additions and 9 deletions

View File

@ -572,15 +572,16 @@ SQL;
*/ */
public function deleteAllRebroadcasts() public function deleteAllRebroadcasts()
{ {
$con = Propel::getConnection(); $sql = <<<SQL
DELETE
$timestamp = gmdate("Y-m-d H:i:s"); FROM cc_show_instances
WHERE starts > :timestamp::TIMESTAMP
$showId = $this->getId(); AND show_id :showId
$sql = "DELETE FROM cc_show_instances" AND rebroadcast 1
." WHERE starts > TIMESTAMP '$timestamp'" SQL;
." AND show_id = $showId" Application_Common_Database::prepareAndExecute( $sql,
." AND rebroadcast = 1"; array( ':showId' => $this->getId(),
':timestamp' => gmdate("Y-m-d H:i:s")), 'execute');
$con->exec($sql); $con->exec($sql);
} }