Format code using php-cs-fixer

This commit is contained in:
jo 2021-10-11 16:10:47 +02:00
parent 43d7dc92cd
commit d52c6184b9
352 changed files with 17473 additions and 17041 deletions

View file

@ -1,20 +1,14 @@
<?php
/**
* 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
* long as it does not already exist in the output directory.
*
* @package propel.generator.airtime
*/
class CcShow extends BaseCcShow {
class CcShow extends BaseCcShow
{
/*
* Returns all cc_show_day rules that belong to a cc_show and that are
* repeating.
@ -24,11 +18,13 @@ class CcShow extends BaseCcShow {
* So when the entire cc_show is updated after that, the single edited
* instance can remain separate from the rest of the instances
*/
public function getRepeatingCcShowDays(){
public function getRepeatingCcShowDays()
{
return CcShowDaysQuery::create()
->filterByDbShowId($this->id)
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
->find();
->find()
;
}
/**
@ -40,17 +36,19 @@ class CcShow extends BaseCcShow {
* 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
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
*
* @throws PropelException
*
* @return array|PropelCollection CcShowDays[] List of CcShowDays objects
*/
public function getFirstCcShowDay($criteria = null, PropelPDO $con = null)
{
/*CcShowPeer::clearInstancePool();
CcShowPeer::clearRelatedInstancePool();*/
if(null === $this->collCcShowDayss || null !== $criteria) {
if (null === $this->collCcShowDayss || null !== $criteria) {
if ($this->isNew() && null === $this->collCcShowDayss) {
// return empty collection
$this->initCcShowDayss();
@ -59,22 +57,23 @@ class CcShow extends BaseCcShow {
->filterByCcShow($this)
->orderByDbFirstShow()
->limit(1)
->find($con);
->find($con)
;
if (null !== $criteria) {
return $collCcShowDayss;
}
$this->collCcShowDayss = $collCcShowDayss;
}
}
return $this->collCcShowDayss[0];
}
/**
*
* A repeating show may have a rule in cc_show_days with a repeat type
* of -1 (not repeating). This happens when a single instances was edited
* from the repeating sequence.
*
*
* When the repeating show gets edited in this case, we want to exclude all
* the edited instances from the update. We do this by not returning any of
* the cc_show_day rules with a -1 repeat type.
@ -85,16 +84,16 @@ class CcShow extends BaseCcShow {
->filterByDbShowId($this->id)
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
->orderByDbFirstShow()
->findOne();
->findOne()
;
}
/**
*
* In order to determine if a show is repeating we need to check each
* cc_show_day entry and check if there are any non -1 repeat types.
* Because editing a single instances creates a new cc_show_day rule
* with a -1 (non repeating) repeat type we need to check all cc_show_day
* entries
* entries.
*/
public function isRepeating()
{
@ -102,7 +101,8 @@ class CcShow extends BaseCcShow {
$ccShowDays = CcShowDaysQuery::create()
->filterByDbShowId($this->id)
->filterByDbRepeatType(0, Criteria::GREATER_EQUAL)
->find();
->find()
;
if (!$ccShowDays->isEmpty()) {
return true;
@ -113,7 +113,7 @@ class CcShow extends BaseCcShow {
/**
* Returns all cc_show_instances that have been edited out of
* a repeating sequence
* a repeating sequence.
*/
public function getEditedRepeatingInstanceIds()
{
@ -121,27 +121,29 @@ class CcShow extends BaseCcShow {
$ccShowDays = CcShowDaysQuery::create()
->filterByDbShowId($this->id)
->filterByDbRepeatType(-1)
->find();
->find()
;
$startsUTC = array();
$startsUTC = [];
$utc = new DateTimeZone("UTC");
$utc = new DateTimeZone('UTC');
foreach ($ccShowDays as $day) {
//convert to UTC
$starts = new DateTime(
$day->getDbFirstShow()." ".$day->getDbStartTime(),
$day->getDbFirstShow() . ' ' . $day->getDbStartTime(),
new DateTimeZone($day->getDbTimezone())
);
$starts->setTimezone($utc);
array_push($startsUTC, $starts->format("Y-m-d H:i:s"));
array_push($startsUTC, $starts->format('Y-m-d H:i:s'));
}
$excludeInstances = CcShowInstancesQuery::create()
->filterByDbShowId($this->id)
->filterByDbStarts($startsUTC, criteria::IN)
->find();
->find()
;
$excludeIds = array();
$excludeIds = [];
foreach ($excludeInstances as $instance) {
array_push($excludeIds, $instance->getDbId());
}
@ -158,29 +160,33 @@ class CcShow extends BaseCcShow {
* 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
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
*
* @throws PropelException
*
* @return array|PropelCollection CcShowInstances[] List of CcShowInstances objects
*/
public function getFutureCcShowInstancess($criteria = null, PropelPDO $con = null)
{
if(null === $this->collCcShowInstancess || null !== $criteria) {
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)
->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_THAN)
->filterByDbModifiedInstance(false)
->find($con);
->find($con)
;
if (null !== $criteria) {
return $collCcShowInstancess;
}
$this->collCcShowInstancess = $collCcShowInstancess;
}
}
return $this->collCcShowInstancess;
}
@ -189,18 +195,20 @@ class CcShow extends BaseCcShow {
$ccShowDay = CcShowDaysQuery::create()
->filterByDbShowId($this->getDbId())
->filterByDbRecord(1)
->findOne();
->findOne()
;
return (!is_null($ccShowDay));
return !is_null($ccShowDay);
}
public function isRebroadcast()
{
$ccShowRebroadcast = CcShowRebroadcastQuery::create()
->filterByDbShowId($this->getDbId())
->findOne();
->findOne()
;
return (!is_null($ccShowRebroadcast));
return !is_null($ccShowRebroadcast);
}
public function getRebroadcastsRelative()
@ -208,7 +216,8 @@ class CcShow extends BaseCcShow {
return CcShowRebroadcastQuery::create()
->filterByDbShowId($this->getDbId())
->orderByDbDayOffset()
->find();
->find()
;
}
public function getRebroadcastsAbsolute()
@ -218,7 +227,8 @@ class CcShow extends BaseCcShow {
->filterByDbRebroadcast(1)
->filterByDbModifiedInstance(false)
->orderByDbStarts()
->find();
->find()
;
}
public function isLinked()
@ -240,18 +250,21 @@ class CcShow extends BaseCcShow {
* 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
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
*
* @throws PropelException
*
* @return array|PropelCollection CcShowInstances[] List of CcShowInstances objects
*/
public function getCcShowInstancess($criteria = null, PropelPDO $con = null)
{
return CcShowInstancesQuery::create(null, $criteria)
->filterByCcShow($this)
->filterByDbModifiedInstance(false)
->orderByDbId()
->find($con);
->filterByCcShow($this)
->filterByDbModifiedInstance(false)
->orderByDbId()
->find($con)
;
/*if(null === $this->collCcShowInstancess || null !== $criteria) {
if ($this->isNew() && null === $this->collCcShowInstancess) {
@ -273,26 +286,30 @@ class CcShow extends BaseCcShow {
return $this->collCcShowInstancess;*/
}
public function getInstanceIds() {
$instanceIds = array();
public function getInstanceIds()
{
$instanceIds = [];
foreach ($this->getCcShowInstancess() as $ccShowInstance) {
$instanceIds[] = $ccShowInstance->getDbId();
}
return $instanceIds;
}
/*
* Returns cc_show_instance ids where the start time is greater than
* the current time
*
* If a Criteria object is passed in Propel will always fetch the
*
* If a Criteria object is passed in Propel will always fetch the
* results from the database and not return a cached collection
*/
public function getFutureInstanceIds($criteria = null) {
$instanceIds = array();
public function getFutureInstanceIds($criteria = null)
{
$instanceIds = [];
foreach ($this->getFutureCcShowInstancess($criteria) as $ccShowInstance) {
$instanceIds[] = $ccShowInstance->getDbId();
}
return $instanceIds;
}
@ -302,28 +319,28 @@ class CcShow extends BaseCcShow {
return CcShowInstancesQuery::create()
->filterByCcShow($this)
->filterByDbId($instanceId, Criteria::NOT_EQUAL)
->find();
->find()
;
}
public function getShowInfo()
{
$info = array();
$info = [];
if ($this->getDbId() == null) {
return $info;
} else {
$info['name'] = $this->getDbName();
$info['id'] = $this->getDbId();
$info['url'] = $this->getDbUrl();
$info['genre'] = $this->getDbGenre();
$info['description'] = $this->getDbDescription();
$info['color'] = $this->getDbColor();
$info['background_color'] = $this->getDbBackgroundColor();
$info['linked'] = $this->getDbLinked();
$info['has_autoplaylist'] = $this->getDbHasAutoPlaylist();
$info['autoplaylist_id'] = $this->getDbAutoPlaylistId();
$info['autoplaylist_repeat'] = $this->getDbAutoPlaylistRepeat();
return $info;
}
$info['name'] = $this->getDbName();
$info['id'] = $this->getDbId();
$info['url'] = $this->getDbUrl();
$info['genre'] = $this->getDbGenre();
$info['description'] = $this->getDbDescription();
$info['color'] = $this->getDbColor();
$info['background_color'] = $this->getDbBackgroundColor();
$info['linked'] = $this->getDbLinked();
$info['has_autoplaylist'] = $this->getDbHasAutoPlaylist();
$info['autoplaylist_id'] = $this->getDbAutoPlaylistId();
$info['autoplaylist_repeat'] = $this->getDbAutoPlaylistRepeat();
return $info;
}
} // CcShow