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()
{
$con = Propel::getConnection();
$timestamp = gmdate("Y-m-d H:i:s");
$showId = $this->getId();
$sql = "DELETE FROM cc_show_instances"
." WHERE starts > TIMESTAMP '$timestamp'"
." AND show_id = $showId";
$con->exec($sql);
$sql = <<<SQL
DELETE
FROM cc_show_instances
WHERE starts > :timestamp::TIMESTAMP
AND show_id = :showId
SQL;
Application_Common_Database::prepareAndExecute( $sql,
array( ':timestamp' => gmdate("Y-m-d H:i:s"),
':showId' => $this->getId()), 'execute');
}
/**