From 463d286ac50097b8633307e7db9be0644be3e4f7 Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 4 Dec 2013 14:00:31 -0500 Subject: [PATCH] CC-5405: When editing a single show instance from a repeating series, should not create a new cc_show Refactored cc_show->isRepeating() function --- airtime_mvc/application/models/airtime/CcShow.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/models/airtime/CcShow.php b/airtime_mvc/application/models/airtime/CcShow.php index 99c5aaa75..91874eed6 100644 --- a/airtime_mvc/application/models/airtime/CcShow.php +++ b/airtime_mvc/application/models/airtime/CcShow.php @@ -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;