cc-4347: PDO deleteAllInstances()

This commit is contained in:
Rudi Grinberg 2012-09-07 12:22:49 -04:00
parent 727769b376
commit ad776ff8f3
1 changed files with 9 additions and 10 deletions

View File

@ -555,16 +555,15 @@ SQL;
*/ */
public function deleteAllInstances() public function deleteAllInstances()
{ {
$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" SQL;
." WHERE starts > TIMESTAMP '$timestamp'" Application_Common_Database::prepareAndExecute( $sql,
." AND show_id = $showId"; array( ':timestamp' => gmdate("Y-m-d H:i:s"),
':showId' => $this->getId()), 'execute');
$con->exec($sql);
} }
/** /**