From d13d0fbad09c4635f1442cb104b16a555d41883b Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Mon, 23 Sep 2013 12:17:16 +0200 Subject: [PATCH] CC-5333 : Rebroadcast Shows are not created redefining isRecorded and isRebroadcast, these methods should not rely on already created show instances. --- airtime_mvc/application/models/airtime/CcShow.php | 13 +++++-------- airtime_mvc/application/services/ShowService.php | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/airtime_mvc/application/models/airtime/CcShow.php b/airtime_mvc/application/models/airtime/CcShow.php index b345a8d05..028ec6fea 100644 --- a/airtime_mvc/application/models/airtime/CcShow.php +++ b/airtime_mvc/application/models/airtime/CcShow.php @@ -5,7 +5,7 @@ /** * Skeleton subclass for representing a row from the 'cc_show' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -91,24 +91,21 @@ class CcShow extends BaseCcShow { public function isRecorded() { - $ccShowInstances = CcShowInstancesQuery::create() + $ccShowDay = CcShowDaysQuery::create() ->filterByDbShowId($this->getDbId()) ->filterByDbRecord(1) - ->filterByDbModifiedInstance(false) ->findOne(); - return (!is_null($ccShowInstances)); + return (!is_null($ccShowDay)); } public function isRebroadcast() { - $ccShowInstances = CcShowInstancesQuery::create() + $ccShowRebroadcast = CcShowRebroadcastQuery::create() ->filterByDbShowId($this->getDbId()) - ->filterByDbRebroadcast(1) - ->filterByDbModifiedInstance(false) ->findOne(); - return (!is_null($ccShowInstances)); + return (!is_null($ccShowRebroadcast)); } public function getRebroadcastsRelative() diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 977c23eca..33ef3cb0d 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -196,8 +196,8 @@ class Application_Service_ShowService foreach ($ccShowDays as $day) { $this->ccShow = $day->getCcShow(); - $this->isRecorded = isset($this->isRecorded) ? $this->isRecorded : $this->ccShow->isRecorded(); - $this->isRebroadcast = isset($this->isRebroadcast) ? $this->isRebroadcast : $this->ccShow->isRebroadcast(); + $this->isRecorded = $this->ccShow->isRecorded(); + $this->isRebroadcast = $this->ccShow->isRebroadcast(); if (!isset($ccShows[$day->getDbShowId()])) { $ccShows[$day->getDbShowId()] = $day->getccShow();