CC-5333 : Rebroadcast Shows are not created

redefining isRecorded and isRebroadcast, these methods should not rely on already created show instances.
This commit is contained in:
Naomi Aro 2013-09-23 12:17:16 +02:00
parent bbbf0b2c1d
commit d13d0fbad0
2 changed files with 7 additions and 10 deletions

View File

@ -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()

View File

@ -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();