CC-5593: Overlapping Show Bug

Get instance depending on whether instance id is provided or not
This commit is contained in:
drigato 2013-12-03 15:07:40 -05:00
parent d49131db48
commit c18d53f403
1 changed files with 10 additions and 4 deletions

View File

@ -1282,10 +1282,16 @@ SQL;
$update=false, $instanceId=null, $showId=null)
{
//if the show instance does not exist or was deleted, return false
$ccShowInstance = CcShowInstancesQuery::create()
->filterByDbShowId($showId)
->filterByDbStarts($show_start->format("Y-m-d H:i:s"))
->findOne();
if (!is_null($showId)) {
$ccShowInstance = CcShowInstancesQuery::create()
->filterByDbShowId($showId)
->filterByDbStarts($show_start->format("Y-m-d H:i:s"))
->findOne();
} elseif (!is_null($instanceId)) {
$ccShowInstance = CcShowInstancesQuery::create()
->filterByDbId($instanceId)
->findOne();
}
if (!$ccShowInstance || $ccShowInstance->getDbModifiedInstance() == true) {
return false;
}