CC-4961: Show linking
Refactored services Removed ShowDaysService and ShowInstanceService Combined all show actions into one ShowService
This commit is contained in:
parent
bae9f1202a
commit
a7601d290f
10 changed files with 1308 additions and 1206 deletions
|
@ -15,4 +15,108 @@
|
|||
*/
|
||||
class CcShow extends BaseCcShow {
|
||||
|
||||
public function getCcShowDays(){
|
||||
return CcShowDaysQuery::create()->filterByDbShowId($this->getDbId())->find();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of CcShowDays objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
* Next time the same method is called without $criteria, the cached collection is returned.
|
||||
* If this CcShow is new, it will return
|
||||
* an empty collection or the current collection; the criteria is ignored on a new object.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @return PropelCollection|array CcShowDays[] List of CcShowDays objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getFirstCcShowDay($criteria = null, PropelPDO $con = null)
|
||||
{
|
||||
if(null === $this->collCcShowDayss || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcShowDayss) {
|
||||
// return empty collection
|
||||
$this->initCcShowDayss();
|
||||
} else {
|
||||
$collCcShowDayss = CcShowDaysQuery::create(null, $criteria)
|
||||
->filterByCcShow($this)
|
||||
->orderByDbFirstShow()
|
||||
->limit(1)
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcShowDayss;
|
||||
}
|
||||
$this->collCcShowDayss = $collCcShowDayss;
|
||||
}
|
||||
}
|
||||
return $this->collCcShowDayss[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of CcShowInstances objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
* Next time the same method is called without $criteria, the cached collection is returned.
|
||||
* If this CcShow is new, it will return
|
||||
* an empty collection or the current collection; the criteria is ignored on a new object.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getFutureCcShowInstancess($criteria = null, PropelPDO $con = null)
|
||||
{
|
||||
if(null === $this->collCcShowInstancess || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcShowInstancess) {
|
||||
// return empty collection
|
||||
$this->initCcShowInstancess();
|
||||
} else {
|
||||
|
||||
$collCcShowInstancess = CcShowInstancesQuery::create(null, $criteria)
|
||||
->filterByCcShow($this)
|
||||
->filterByDbStarts(gmdate("Y-m-d H:i:s"), Criteria::GREATER_THAN)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcShowInstancess;
|
||||
}
|
||||
$this->collCcShowInstancess = $collCcShowInstancess;
|
||||
}
|
||||
}
|
||||
return $this->collCcShowInstancess;
|
||||
}
|
||||
|
||||
public function isRecorded()
|
||||
{
|
||||
$ccShowInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($this->getDbId())
|
||||
->filterByDbRecord(1)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->findOne();
|
||||
|
||||
return (!is_null($ccShowInstances));
|
||||
}
|
||||
|
||||
public function isRebroadcast()
|
||||
{
|
||||
$ccShowInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($this->getDbId())
|
||||
->filterByDbRebroadcast(1)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->findOne();
|
||||
|
||||
return (!is_null($ccShowInstances));
|
||||
}
|
||||
|
||||
public function getRebroadcastsRelative()
|
||||
{
|
||||
return CcShowRebroadcastQuery::create()
|
||||
->filterByDbShowId($this->getDbId())
|
||||
->orderByDbDayOffset()
|
||||
->find();
|
||||
}
|
||||
} // CcShow
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue