CC-84: Smart Playlists
- introducing smart-block
This commit is contained in:
parent
722e470f6f
commit
1f3cbd8aba
56 changed files with 12502 additions and 734 deletions
|
@ -85,11 +85,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $collCcPlaylistcontentss;
|
||||
|
||||
/**
|
||||
* @var array CcPlaylistcriteria[] Collection to store aggregation of CcPlaylistcriteria objects.
|
||||
*/
|
||||
protected $collCcPlaylistcriterias;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
|
@ -603,8 +598,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
$this->aCcSubjs = null;
|
||||
$this->collCcPlaylistcontentss = null;
|
||||
|
||||
$this->collCcPlaylistcriterias = null;
|
||||
|
||||
} // if (deep)
|
||||
}
|
||||
|
||||
|
@ -758,14 +751,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->collCcPlaylistcriterias !== null) {
|
||||
foreach ($this->collCcPlaylistcriterias as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted()) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->alreadyInSave = false;
|
||||
|
||||
}
|
||||
|
@ -857,14 +842,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->collCcPlaylistcriterias !== null) {
|
||||
foreach ($this->collCcPlaylistcriterias as $referrerFK) {
|
||||
if (!$referrerFK->validate($columns)) {
|
||||
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->alreadyInValidation = false;
|
||||
}
|
||||
|
@ -1145,12 +1122,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($this->getCcPlaylistcriterias() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCcPlaylistcriteria($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
} // if ($deepCopy)
|
||||
|
||||
|
||||
|
@ -1379,113 +1350,29 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
return $this->getCcPlaylistcontentss($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCcPlaylistcriterias collection
|
||||
*
|
||||
* This does not modify the database; however, it will remove any associated objects, causing
|
||||
* them to be refetched by subsequent calls to accessor method.
|
||||
*
|
||||
* @return void
|
||||
* @see addCcPlaylistcriterias()
|
||||
*/
|
||||
public function clearCcPlaylistcriterias()
|
||||
{
|
||||
$this->collCcPlaylistcriterias = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collCcPlaylistcriterias collection.
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this CcPlaylist is new, it will return
|
||||
* an empty collection; or if this CcPlaylist has previously
|
||||
* been saved, it will retrieve related CcPlaylistcontentss from storage.
|
||||
*
|
||||
* By default this just sets the collCcPlaylistcriterias collection to an empty array (like clearcollCcPlaylistcriterias());
|
||||
* however, you may wish to override this method in your stub class to provide setting appropriate
|
||||
* to your application -- for example, setting the initial array to the values stored in database.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initCcPlaylistcriterias()
|
||||
{
|
||||
$this->collCcPlaylistcriterias = new PropelObjectCollection();
|
||||
$this->collCcPlaylistcriterias->setModel('CcPlaylistcriteria');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of CcPlaylistcriteria 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 CcPlaylist is new, it will return
|
||||
* an empty collection or the current collection; the criteria is ignored on a new object.
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in CcPlaylist.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @return PropelCollection|array CcPlaylistcriteria[] List of CcPlaylistcriteria objects
|
||||
* @throws PropelException
|
||||
* @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return PropelCollection|array CcPlaylistcontents[] List of CcPlaylistcontents objects
|
||||
*/
|
||||
public function getCcPlaylistcriterias($criteria = null, PropelPDO $con = null)
|
||||
public function getCcPlaylistcontentssJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
if(null === $this->collCcPlaylistcriterias || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcPlaylistcriterias) {
|
||||
// return empty collection
|
||||
$this->initCcPlaylistcriterias();
|
||||
} else {
|
||||
$collCcPlaylistcriterias = CcPlaylistcriteriaQuery::create(null, $criteria)
|
||||
->filterByCcPlaylist($this)
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcPlaylistcriterias;
|
||||
}
|
||||
$this->collCcPlaylistcriterias = $collCcPlaylistcriterias;
|
||||
}
|
||||
}
|
||||
return $this->collCcPlaylistcriterias;
|
||||
}
|
||||
$query = CcPlaylistcontentsQuery::create(null, $criteria);
|
||||
$query->joinWith('CcBlock', $join_behavior);
|
||||
|
||||
/**
|
||||
* Returns the number of related CcPlaylistcriteria objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param PropelPDO $con
|
||||
* @return int Count of related CcPlaylistcriteria objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countCcPlaylistcriterias(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
|
||||
{
|
||||
if(null === $this->collCcPlaylistcriterias || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcPlaylistcriterias) {
|
||||
return 0;
|
||||
} else {
|
||||
$query = CcPlaylistcriteriaQuery::create(null, $criteria);
|
||||
if($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
return $query
|
||||
->filterByCcPlaylist($this)
|
||||
->count($con);
|
||||
}
|
||||
} else {
|
||||
return count($this->collCcPlaylistcriterias);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a CcPlaylistcriteria object to this object
|
||||
* through the CcPlaylistcriteria foreign key attribute.
|
||||
*
|
||||
* @param CcPlaylistcriteria $l CcPlaylistcriteria
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function addCcPlaylistcriteria(CcPlaylistcriteria $l)
|
||||
{
|
||||
if ($this->collCcPlaylistcriterias === null) {
|
||||
$this->initCcPlaylistcriterias();
|
||||
}
|
||||
if (!$this->collCcPlaylistcriterias->contains($l)) { // only add it if the **same** object is not already associated
|
||||
$this->collCcPlaylistcriterias[]= $l;
|
||||
$l->setCcPlaylist($this);
|
||||
}
|
||||
return $this->getCcPlaylistcontentss($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1527,15 +1414,9 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collCcPlaylistcriterias) {
|
||||
foreach ((array) $this->collCcPlaylistcriterias as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
} // if ($deep)
|
||||
|
||||
$this->collCcPlaylistcontentss = null;
|
||||
$this->collCcPlaylistcriterias = null;
|
||||
$this->aCcSubjs = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue