CC-3696: more rebroadcast show instances will be created after change the calendar
-fixed
This commit is contained in:
parent
b5bf5e9598
commit
34a1949511
2 changed files with 47 additions and 36 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue