CC-5405: When editing a single show instance from a repeating series, should not create a new cc_show

Refactored cc_show->isRepeating() function
This commit is contained in:
drigato 2013-12-04 14:00:31 -05:00
parent b78fa994f7
commit 463d286ac5
1 changed files with 4 additions and 5 deletions

View File

@ -95,15 +95,14 @@ class CcShow extends BaseCcShow {
*/
public function isRepeating()
{
//get ALL cc_show_day entries
//get all cc_show_day entries that are repeating
$ccShowDays = CcShowDaysQuery::create()
->filterByDbShowId($this->id)
->filterByDbRepeatType(0, Criteria::GREATER_EQUAL)
->find();
foreach ($ccShowDays as $day) {
if ($day->getDbRepeatType() >= 0) {
return true;
}
if (!$ccShowDays->isEmpty()) {
return true;
}
return false;