CC-3696: more rebroadcast show instances will be created after change the calendar

-fixed
This commit is contained in:
Martin Konecny 2012-04-25 15:09:58 -04:00
parent b5bf5e9598
commit 34a1949511
2 changed files with 47 additions and 36 deletions

View file

@ -30,6 +30,20 @@ class Application_Model_ShowInstance {
public function getShow(){
return new Application_Model_Show($this->getShowId());
}
public function deleteRebroadcasts(){
$con = Propel::getConnection();
$timestamp = gmdate("Y-m-d H:i:s");
$instance_id = $this->getShowInstanceId();
$sql = "DELETE FROM cc_show_instances"
." WHERE starts > TIMESTAMP '$timestamp'"
." AND instance_id = $instance_id"
." AND rebroadcast = 1";
$con->exec($sql);
}
/* This function is weird. It should return a boolean, but instead returns
* an integer if it is a rebroadcast, or returns null if it isn't. You can convert