PDO'd a few things missed before in cancelShow()

This commit is contained in:
Rudi Grinberg 2012-09-12 12:05:03 -04:00
parent 6d32c03351
commit d194ff1809
1 changed files with 12 additions and 5 deletions

View File

@ -287,11 +287,16 @@ SQL;
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->update(array('DbLastShow' => $timeinfo[0])); ->update(array('DbLastShow' => $timeinfo[0]));
$sql = "UPDATE cc_show_instances $sql = <<<SQL
SET modified_instance = TRUE UPDATE cc_show_instances
WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}"; SET modified_instance = TRUE
WHERE starts >= :dayTimestamp::TIMESTAMP
AND show_id = :showId
SQL;
$con->exec($sql); Application_Common_Database::prepareAndExecute( $sql, array(
':dayTimestamp' => $day_timestamp,
':showId' => $this->getId()), 'execute');
// check if we can safely delete the show // check if we can safely delete the show
$showInstancesRow = CcShowInstancesQuery::create() $showInstancesRow = CcShowInstancesQuery::create()
@ -300,7 +305,9 @@ SQL;
->findOne(); ->findOne();
if (is_null($showInstancesRow)) { if (is_null($showInstancesRow)) {
$sql = "DELETE FROM cc_show WHERE id = :show_id"; $sql = <<<SQL
DELETE FROM cc_show WHERE id = :show_id
SQL;
Application_Common_Database::prepareAndExecute( Application_Common_Database::prepareAndExecute(
$sql, array( 'show_id' => $this->_showId ), "execute"); $sql, array( 'show_id' => $this->_showId ), "execute");
$con->exec($sql); $con->exec($sql);