SAAS-1058: Podcast table schema

Renamed podcast_contents to podcast_episodes
Added new columns to podcast_episodes table
This commit is contained in:
drigato 2015-09-18 09:51:44 -04:00
parent f6f23864ce
commit 9a2e9d1b3b
18 changed files with 889 additions and 637 deletions

View file

@ -107,9 +107,9 @@ return array (
'BaseCloudFilePeer' => 'airtime/om/BaseCloudFilePeer.php', 'BaseCloudFilePeer' => 'airtime/om/BaseCloudFilePeer.php',
'BaseCloudFileQuery' => 'airtime/om/BaseCloudFileQuery.php', 'BaseCloudFileQuery' => 'airtime/om/BaseCloudFileQuery.php',
'BasePodcast' => 'airtime/om/BasePodcast.php', 'BasePodcast' => 'airtime/om/BasePodcast.php',
'BasePodcastContents' => 'airtime/om/BasePodcastContents.php', 'BasePodcastEpisodes' => 'airtime/om/BasePodcastEpisodes.php',
'BasePodcastContentsPeer' => 'airtime/om/BasePodcastContentsPeer.php', 'BasePodcastEpisodesPeer' => 'airtime/om/BasePodcastEpisodesPeer.php',
'BasePodcastContentsQuery' => 'airtime/om/BasePodcastContentsQuery.php', 'BasePodcastEpisodesQuery' => 'airtime/om/BasePodcastEpisodesQuery.php',
'BasePodcastPeer' => 'airtime/om/BasePodcastPeer.php', 'BasePodcastPeer' => 'airtime/om/BasePodcastPeer.php',
'BasePodcastQuery' => 'airtime/om/BasePodcastQuery.php', 'BasePodcastQuery' => 'airtime/om/BasePodcastQuery.php',
'BaseThirdPartyTrackReferences' => 'airtime/om/BaseThirdPartyTrackReferences.php', 'BaseThirdPartyTrackReferences' => 'airtime/om/BaseThirdPartyTrackReferences.php',
@ -256,10 +256,10 @@ return array (
'CloudFileQuery' => 'airtime/CloudFileQuery.php', 'CloudFileQuery' => 'airtime/CloudFileQuery.php',
'CloudFileTableMap' => 'airtime/map/CloudFileTableMap.php', 'CloudFileTableMap' => 'airtime/map/CloudFileTableMap.php',
'Podcast' => 'airtime/Podcast.php', 'Podcast' => 'airtime/Podcast.php',
'PodcastContents' => 'airtime/PodcastContents.php', 'PodcastEpisodes' => 'airtime/PodcastEpisodes.php',
'PodcastContentsPeer' => 'airtime/PodcastContentsPeer.php', 'PodcastEpisodesPeer' => 'airtime/PodcastEpisodesPeer.php',
'PodcastContentsQuery' => 'airtime/PodcastContentsQuery.php', 'PodcastEpisodesQuery' => 'airtime/PodcastEpisodesQuery.php',
'PodcastContentsTableMap' => 'airtime/map/PodcastContentsTableMap.php', 'PodcastEpisodesTableMap' => 'airtime/map/PodcastEpisodesTableMap.php',
'PodcastPeer' => 'airtime/PodcastPeer.php', 'PodcastPeer' => 'airtime/PodcastPeer.php',
'PodcastQuery' => 'airtime/PodcastQuery.php', 'PodcastQuery' => 'airtime/PodcastQuery.php',
'PodcastTableMap' => 'airtime/map/PodcastTableMap.php', 'PodcastTableMap' => 'airtime/map/PodcastTableMap.php',

View file

@ -3,7 +3,7 @@
/** /**
* Skeleton subclass for representing a row from the 'podcast_contents' table. * Skeleton subclass for representing a row from the 'podcast_episodes' table.
* *
* *
* *
@ -13,6 +13,6 @@
* *
* @package propel.generator.airtime * @package propel.generator.airtime
*/ */
class PodcastContents extends BasePodcastContents class PodcastEpisodes extends BasePodcastEpisodes
{ {
} }

View file

@ -3,7 +3,7 @@
/** /**
* Skeleton subclass for performing query and update operations on the 'podcast_contents' table. * Skeleton subclass for performing query and update operations on the 'podcast_episodes' table.
* *
* *
* *
@ -13,6 +13,6 @@
* *
* @package propel.generator.airtime * @package propel.generator.airtime
*/ */
class PodcastContentsPeer extends BasePodcastContentsPeer class PodcastEpisodesPeer extends BasePodcastEpisodesPeer
{ {
} }

View file

@ -3,7 +3,7 @@
/** /**
* Skeleton subclass for performing query and update operations on the 'podcast_contents' table. * Skeleton subclass for performing query and update operations on the 'podcast_episodes' table.
* *
* *
* *
@ -13,6 +13,6 @@
* *
* @package propel.generator.airtime * @package propel.generator.airtime
*/ */
class PodcastContentsQuery extends BasePodcastContentsQuery class PodcastEpisodesQuery extends BasePodcastEpisodesQuery
{ {
} }

View file

@ -129,7 +129,7 @@ class CcFilesTableMap extends TableMap
$this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null, 'CcSchedules'); $this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null, 'CcSchedules');
$this->addRelation('CcPlayoutHistory', 'CcPlayoutHistory', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null, 'CcPlayoutHistorys'); $this->addRelation('CcPlayoutHistory', 'CcPlayoutHistory', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null, 'CcPlayoutHistorys');
$this->addRelation('ThirdPartyTrackReferences', 'ThirdPartyTrackReferences', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null, 'ThirdPartyTrackReferencess'); $this->addRelation('ThirdPartyTrackReferences', 'ThirdPartyTrackReferences', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null, 'ThirdPartyTrackReferencess');
$this->addRelation('PodcastContents', 'PodcastContents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null, 'PodcastContentss'); $this->addRelation('PodcastEpisodes', 'PodcastEpisodes', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null, 'PodcastEpisodess');
} // buildRelations() } // buildRelations()
} // CcFilesTableMap } // CcFilesTableMap

View file

@ -0,0 +1,60 @@
<?php
/**
* This class defines the structure of the 'podcast_episodes' table.
*
*
*
* This map class is used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package propel.generator.airtime.map
*/
class PodcastEpisodesTableMap extends TableMap
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'airtime.map.PodcastEpisodesTableMap';
/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
*/
public function initialize()
{
// attributes
$this->setName('podcast_episodes');
$this->setPhpName('PodcastEpisodes');
$this->setClassname('PodcastEpisodes');
$this->setPackage('airtime');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('podcast_episodes_id_seq');
// columns
$this->addPrimaryKey('id', 'DbId', 'INTEGER', true, null, null);
$this->addForeignKey('file_id', 'DbFileId', 'INTEGER', 'cc_files', 'id', true, null, null);
$this->addForeignKey('podcast_id', 'DbPodcastId', 'INTEGER', 'podcast', 'id', true, null, null);
$this->addColumn('publication_date', 'DbPublicationDate', 'TIMESTAMP', true, null, null);
$this->addColumn('download_url', 'DbDownloadUrl', 'VARCHAR', true, 512, null);
$this->addColumn('episode_guid', 'DbEpisodeGuid', 'VARCHAR', true, 512, null);
// validators
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null);
$this->addRelation('Podcast', 'Podcast', RelationMap::MANY_TO_ONE, array('podcast_id' => 'id', ), 'CASCADE', null);
} // buildRelations()
} // PodcastEpisodesTableMap

View file

@ -56,7 +56,7 @@ class PodcastTableMap extends TableMap
public function buildRelations() public function buildRelations()
{ {
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('owner' => 'id', ), 'CASCADE', null); $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('owner' => 'id', ), 'CASCADE', null);
$this->addRelation('PodcastContents', 'PodcastContents', RelationMap::ONE_TO_MANY, array('id' => 'podcast_id', ), 'CASCADE', null, 'PodcastContentss'); $this->addRelation('PodcastEpisodes', 'PodcastEpisodes', RelationMap::ONE_TO_MANY, array('id' => 'podcast_id', ), 'CASCADE', null, 'PodcastEpisodess');
} // buildRelations() } // buildRelations()
} // PodcastTableMap } // PodcastTableMap

View file

@ -534,10 +534,10 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
protected $collThirdPartyTrackReferencessPartial; protected $collThirdPartyTrackReferencessPartial;
/** /**
* @var PropelObjectCollection|PodcastContents[] Collection to store aggregation of PodcastContents objects. * @var PropelObjectCollection|PodcastEpisodes[] Collection to store aggregation of PodcastEpisodes objects.
*/ */
protected $collPodcastContentss; protected $collPodcastEpisodess;
protected $collPodcastContentssPartial; protected $collPodcastEpisodessPartial;
/** /**
* Flag to prevent endless save loop, if this object is referenced * Flag to prevent endless save loop, if this object is referenced
@ -605,7 +605,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
* An array of objects scheduled for deletion. * An array of objects scheduled for deletion.
* @var PropelObjectCollection * @var PropelObjectCollection
*/ */
protected $podcastContentssScheduledForDeletion = null; protected $podcastEpisodessScheduledForDeletion = null;
/** /**
* Applies default values to this object. * Applies default values to this object.
@ -3363,7 +3363,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->collThirdPartyTrackReferencess = null; $this->collThirdPartyTrackReferencess = null;
$this->collPodcastContentss = null; $this->collPodcastEpisodess = null;
} // if (deep) } // if (deep)
} }
@ -3634,17 +3634,17 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
} }
} }
if ($this->podcastContentssScheduledForDeletion !== null) { if ($this->podcastEpisodessScheduledForDeletion !== null) {
if (!$this->podcastContentssScheduledForDeletion->isEmpty()) { if (!$this->podcastEpisodessScheduledForDeletion->isEmpty()) {
PodcastContentsQuery::create() PodcastEpisodesQuery::create()
->filterByPrimaryKeys($this->podcastContentssScheduledForDeletion->getPrimaryKeys(false)) ->filterByPrimaryKeys($this->podcastEpisodessScheduledForDeletion->getPrimaryKeys(false))
->delete($con); ->delete($con);
$this->podcastContentssScheduledForDeletion = null; $this->podcastEpisodessScheduledForDeletion = null;
} }
} }
if ($this->collPodcastContentss !== null) { if ($this->collPodcastEpisodess !== null) {
foreach ($this->collPodcastContentss as $referrerFK) { foreach ($this->collPodcastEpisodess as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con); $affectedRows += $referrerFK->save($con);
} }
@ -4302,8 +4302,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
} }
} }
if ($this->collPodcastContentss !== null) { if ($this->collPodcastEpisodess !== null) {
foreach ($this->collPodcastContentss as $referrerFK) { foreach ($this->collPodcastEpisodess as $referrerFK) {
if (!$referrerFK->validate($columns)) { if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
} }
@ -4699,8 +4699,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if (null !== $this->collThirdPartyTrackReferencess) { if (null !== $this->collThirdPartyTrackReferencess) {
$result['ThirdPartyTrackReferencess'] = $this->collThirdPartyTrackReferencess->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); $result['ThirdPartyTrackReferencess'] = $this->collThirdPartyTrackReferencess->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
} }
if (null !== $this->collPodcastContentss) { if (null !== $this->collPodcastEpisodess) {
$result['PodcastContentss'] = $this->collPodcastContentss->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); $result['PodcastEpisodess'] = $this->collPodcastEpisodess->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
} }
} }
@ -5315,9 +5315,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
} }
} }
foreach ($this->getPodcastContentss() as $relObj) { foreach ($this->getPodcastEpisodess() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addPodcastContents($relObj->copy($deepCopy)); $copyObj->addPodcastEpisodes($relObj->copy($deepCopy));
} }
} }
@ -5559,8 +5559,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if ('ThirdPartyTrackReferences' == $relationName) { if ('ThirdPartyTrackReferences' == $relationName) {
$this->initThirdPartyTrackReferencess(); $this->initThirdPartyTrackReferencess();
} }
if ('PodcastContents' == $relationName) { if ('PodcastEpisodes' == $relationName) {
$this->initPodcastContentss(); $this->initPodcastEpisodess();
} }
} }
@ -7340,36 +7340,36 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
} }
/** /**
* Clears out the collPodcastContentss collection * Clears out the collPodcastEpisodess collection
* *
* This does not modify the database; however, it will remove any associated objects, causing * This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method. * them to be refetched by subsequent calls to accessor method.
* *
* @return CcFiles The current object (for fluent API support) * @return CcFiles The current object (for fluent API support)
* @see addPodcastContentss() * @see addPodcastEpisodess()
*/ */
public function clearPodcastContentss() public function clearPodcastEpisodess()
{ {
$this->collPodcastContentss = null; // important to set this to null since that means it is uninitialized $this->collPodcastEpisodess = null; // important to set this to null since that means it is uninitialized
$this->collPodcastContentssPartial = null; $this->collPodcastEpisodessPartial = null;
return $this; return $this;
} }
/** /**
* reset is the collPodcastContentss collection loaded partially * reset is the collPodcastEpisodess collection loaded partially
* *
* @return void * @return void
*/ */
public function resetPartialPodcastContentss($v = true) public function resetPartialPodcastEpisodess($v = true)
{ {
$this->collPodcastContentssPartial = $v; $this->collPodcastEpisodessPartial = $v;
} }
/** /**
* Initializes the collPodcastContentss collection. * Initializes the collPodcastEpisodess collection.
* *
* By default this just sets the collPodcastContentss collection to an empty array (like clearcollPodcastContentss()); * By default this just sets the collPodcastEpisodess collection to an empty array (like clearcollPodcastEpisodess());
* however, you may wish to override this method in your stub class to provide setting appropriate * 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. * to your application -- for example, setting the initial array to the values stored in database.
* *
@ -7378,17 +7378,17 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
* *
* @return void * @return void
*/ */
public function initPodcastContentss($overrideExisting = true) public function initPodcastEpisodess($overrideExisting = true)
{ {
if (null !== $this->collPodcastContentss && !$overrideExisting) { if (null !== $this->collPodcastEpisodess && !$overrideExisting) {
return; return;
} }
$this->collPodcastContentss = new PropelObjectCollection(); $this->collPodcastEpisodess = new PropelObjectCollection();
$this->collPodcastContentss->setModel('PodcastContents'); $this->collPodcastEpisodess->setModel('PodcastEpisodes');
} }
/** /**
* Gets an array of PodcastContents objects which contain a foreign key that references this object. * Gets an array of PodcastEpisodes 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. * 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. * Otherwise the results are fetched from the database the first time, then cached.
@ -7398,107 +7398,107 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
* *
* @param Criteria $criteria optional Criteria object to narrow the query * @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object * @param PropelPDO $con optional connection object
* @return PropelObjectCollection|PodcastContents[] List of PodcastContents objects * @return PropelObjectCollection|PodcastEpisodes[] List of PodcastEpisodes objects
* @throws PropelException * @throws PropelException
*/ */
public function getPodcastContentss($criteria = null, PropelPDO $con = null) public function getPodcastEpisodess($criteria = null, PropelPDO $con = null)
{ {
$partial = $this->collPodcastContentssPartial && !$this->isNew(); $partial = $this->collPodcastEpisodessPartial && !$this->isNew();
if (null === $this->collPodcastContentss || null !== $criteria || $partial) { if (null === $this->collPodcastEpisodess || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collPodcastContentss) { if ($this->isNew() && null === $this->collPodcastEpisodess) {
// return empty collection // return empty collection
$this->initPodcastContentss(); $this->initPodcastEpisodess();
} else { } else {
$collPodcastContentss = PodcastContentsQuery::create(null, $criteria) $collPodcastEpisodess = PodcastEpisodesQuery::create(null, $criteria)
->filterByCcFiles($this) ->filterByCcFiles($this)
->find($con); ->find($con);
if (null !== $criteria) { if (null !== $criteria) {
if (false !== $this->collPodcastContentssPartial && count($collPodcastContentss)) { if (false !== $this->collPodcastEpisodessPartial && count($collPodcastEpisodess)) {
$this->initPodcastContentss(false); $this->initPodcastEpisodess(false);
foreach ($collPodcastContentss as $obj) { foreach ($collPodcastEpisodess as $obj) {
if (false == $this->collPodcastContentss->contains($obj)) { if (false == $this->collPodcastEpisodess->contains($obj)) {
$this->collPodcastContentss->append($obj); $this->collPodcastEpisodess->append($obj);
} }
} }
$this->collPodcastContentssPartial = true; $this->collPodcastEpisodessPartial = true;
} }
$collPodcastContentss->getInternalIterator()->rewind(); $collPodcastEpisodess->getInternalIterator()->rewind();
return $collPodcastContentss; return $collPodcastEpisodess;
} }
if ($partial && $this->collPodcastContentss) { if ($partial && $this->collPodcastEpisodess) {
foreach ($this->collPodcastContentss as $obj) { foreach ($this->collPodcastEpisodess as $obj) {
if ($obj->isNew()) { if ($obj->isNew()) {
$collPodcastContentss[] = $obj; $collPodcastEpisodess[] = $obj;
} }
} }
} }
$this->collPodcastContentss = $collPodcastContentss; $this->collPodcastEpisodess = $collPodcastEpisodess;
$this->collPodcastContentssPartial = false; $this->collPodcastEpisodessPartial = false;
} }
} }
return $this->collPodcastContentss; return $this->collPodcastEpisodess;
} }
/** /**
* Sets a collection of PodcastContents objects related by a one-to-many relationship * Sets a collection of PodcastEpisodes objects related by a one-to-many relationship
* to the current object. * to the current object.
* It will also schedule objects for deletion based on a diff between old objects (aka persisted) * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
* and new objects from the given Propel collection. * and new objects from the given Propel collection.
* *
* @param PropelCollection $podcastContentss A Propel collection. * @param PropelCollection $podcastEpisodess A Propel collection.
* @param PropelPDO $con Optional connection object * @param PropelPDO $con Optional connection object
* @return CcFiles The current object (for fluent API support) * @return CcFiles The current object (for fluent API support)
*/ */
public function setPodcastContentss(PropelCollection $podcastContentss, PropelPDO $con = null) public function setPodcastEpisodess(PropelCollection $podcastEpisodess, PropelPDO $con = null)
{ {
$podcastContentssToDelete = $this->getPodcastContentss(new Criteria(), $con)->diff($podcastContentss); $podcastEpisodessToDelete = $this->getPodcastEpisodess(new Criteria(), $con)->diff($podcastEpisodess);
$this->podcastContentssScheduledForDeletion = $podcastContentssToDelete; $this->podcastEpisodessScheduledForDeletion = $podcastEpisodessToDelete;
foreach ($podcastContentssToDelete as $podcastContentsRemoved) { foreach ($podcastEpisodessToDelete as $podcastEpisodesRemoved) {
$podcastContentsRemoved->setCcFiles(null); $podcastEpisodesRemoved->setCcFiles(null);
} }
$this->collPodcastContentss = null; $this->collPodcastEpisodess = null;
foreach ($podcastContentss as $podcastContents) { foreach ($podcastEpisodess as $podcastEpisodes) {
$this->addPodcastContents($podcastContents); $this->addPodcastEpisodes($podcastEpisodes);
} }
$this->collPodcastContentss = $podcastContentss; $this->collPodcastEpisodess = $podcastEpisodess;
$this->collPodcastContentssPartial = false; $this->collPodcastEpisodessPartial = false;
return $this; return $this;
} }
/** /**
* Returns the number of related PodcastContents objects. * Returns the number of related PodcastEpisodes objects.
* *
* @param Criteria $criteria * @param Criteria $criteria
* @param boolean $distinct * @param boolean $distinct
* @param PropelPDO $con * @param PropelPDO $con
* @return int Count of related PodcastContents objects. * @return int Count of related PodcastEpisodes objects.
* @throws PropelException * @throws PropelException
*/ */
public function countPodcastContentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) public function countPodcastEpisodess(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{ {
$partial = $this->collPodcastContentssPartial && !$this->isNew(); $partial = $this->collPodcastEpisodessPartial && !$this->isNew();
if (null === $this->collPodcastContentss || null !== $criteria || $partial) { if (null === $this->collPodcastEpisodess || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collPodcastContentss) { if ($this->isNew() && null === $this->collPodcastEpisodess) {
return 0; return 0;
} }
if ($partial && !$criteria) { if ($partial && !$criteria) {
return count($this->getPodcastContentss()); return count($this->getPodcastEpisodess());
} }
$query = PodcastContentsQuery::create(null, $criteria); $query = PodcastEpisodesQuery::create(null, $criteria);
if ($distinct) { if ($distinct) {
$query->distinct(); $query->distinct();
} }
@ -7508,28 +7508,28 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
->count($con); ->count($con);
} }
return count($this->collPodcastContentss); return count($this->collPodcastEpisodess);
} }
/** /**
* Method called to associate a PodcastContents object to this object * Method called to associate a PodcastEpisodes object to this object
* through the PodcastContents foreign key attribute. * through the PodcastEpisodes foreign key attribute.
* *
* @param PodcastContents $l PodcastContents * @param PodcastEpisodes $l PodcastEpisodes
* @return CcFiles The current object (for fluent API support) * @return CcFiles The current object (for fluent API support)
*/ */
public function addPodcastContents(PodcastContents $l) public function addPodcastEpisodes(PodcastEpisodes $l)
{ {
if ($this->collPodcastContentss === null) { if ($this->collPodcastEpisodess === null) {
$this->initPodcastContentss(); $this->initPodcastEpisodess();
$this->collPodcastContentssPartial = true; $this->collPodcastEpisodessPartial = true;
} }
if (!in_array($l, $this->collPodcastContentss->getArrayCopy(), true)) { // only add it if the **same** object is not already associated if (!in_array($l, $this->collPodcastEpisodess->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddPodcastContents($l); $this->doAddPodcastEpisodes($l);
if ($this->podcastContentssScheduledForDeletion and $this->podcastContentssScheduledForDeletion->contains($l)) { if ($this->podcastEpisodessScheduledForDeletion and $this->podcastEpisodessScheduledForDeletion->contains($l)) {
$this->podcastContentssScheduledForDeletion->remove($this->podcastContentssScheduledForDeletion->search($l)); $this->podcastEpisodessScheduledForDeletion->remove($this->podcastEpisodessScheduledForDeletion->search($l));
} }
} }
@ -7537,28 +7537,28 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
} }
/** /**
* @param PodcastContents $podcastContents The podcastContents object to add. * @param PodcastEpisodes $podcastEpisodes The podcastEpisodes object to add.
*/ */
protected function doAddPodcastContents($podcastContents) protected function doAddPodcastEpisodes($podcastEpisodes)
{ {
$this->collPodcastContentss[]= $podcastContents; $this->collPodcastEpisodess[]= $podcastEpisodes;
$podcastContents->setCcFiles($this); $podcastEpisodes->setCcFiles($this);
} }
/** /**
* @param PodcastContents $podcastContents The podcastContents object to remove. * @param PodcastEpisodes $podcastEpisodes The podcastEpisodes object to remove.
* @return CcFiles The current object (for fluent API support) * @return CcFiles The current object (for fluent API support)
*/ */
public function removePodcastContents($podcastContents) public function removePodcastEpisodes($podcastEpisodes)
{ {
if ($this->getPodcastContentss()->contains($podcastContents)) { if ($this->getPodcastEpisodess()->contains($podcastEpisodes)) {
$this->collPodcastContentss->remove($this->collPodcastContentss->search($podcastContents)); $this->collPodcastEpisodess->remove($this->collPodcastEpisodess->search($podcastEpisodes));
if (null === $this->podcastContentssScheduledForDeletion) { if (null === $this->podcastEpisodessScheduledForDeletion) {
$this->podcastContentssScheduledForDeletion = clone $this->collPodcastContentss; $this->podcastEpisodessScheduledForDeletion = clone $this->collPodcastEpisodess;
$this->podcastContentssScheduledForDeletion->clear(); $this->podcastEpisodessScheduledForDeletion->clear();
} }
$this->podcastContentssScheduledForDeletion[]= clone $podcastContents; $this->podcastEpisodessScheduledForDeletion[]= clone $podcastEpisodes;
$podcastContents->setCcFiles(null); $podcastEpisodes->setCcFiles(null);
} }
return $this; return $this;
@ -7570,7 +7570,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
* an identical criteria, it returns the collection. * an identical criteria, it returns the collection.
* Otherwise if this CcFiles is new, it will return * Otherwise if this CcFiles is new, it will return
* an empty collection; or if this CcFiles has previously * an empty collection; or if this CcFiles has previously
* been saved, it will retrieve related PodcastContentss from storage. * been saved, it will retrieve related PodcastEpisodess from storage.
* *
* This method is protected by default in order to keep the public * This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you * api reasonable. You can provide public methods for those you
@ -7579,14 +7579,14 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
* @param Criteria $criteria optional Criteria object to narrow the query * @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object * @param PropelPDO $con optional connection object
* @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return PropelObjectCollection|PodcastContents[] List of PodcastContents objects * @return PropelObjectCollection|PodcastEpisodes[] List of PodcastEpisodes objects
*/ */
public function getPodcastContentssJoinPodcast($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) public function getPodcastEpisodessJoinPodcast($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{ {
$query = PodcastContentsQuery::create(null, $criteria); $query = PodcastEpisodesQuery::create(null, $criteria);
$query->joinWith('Podcast', $join_behavior); $query->joinWith('Podcast', $join_behavior);
return $this->getPodcastContentss($query, $con); return $this->getPodcastEpisodess($query, $con);
} }
/** /**
@ -7724,8 +7724,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$o->clearAllReferences($deep); $o->clearAllReferences($deep);
} }
} }
if ($this->collPodcastContentss) { if ($this->collPodcastEpisodess) {
foreach ($this->collPodcastContentss as $o) { foreach ($this->collPodcastEpisodess as $o) {
$o->clearAllReferences($deep); $o->clearAllReferences($deep);
} }
} }
@ -7770,10 +7770,10 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->collThirdPartyTrackReferencess->clearIterator(); $this->collThirdPartyTrackReferencess->clearIterator();
} }
$this->collThirdPartyTrackReferencess = null; $this->collThirdPartyTrackReferencess = null;
if ($this->collPodcastContentss instanceof PropelCollection) { if ($this->collPodcastEpisodess instanceof PropelCollection) {
$this->collPodcastContentss->clearIterator(); $this->collPodcastEpisodess->clearIterator();
} }
$this->collPodcastContentss = null; $this->collPodcastEpisodess = null;
$this->aFkOwner = null; $this->aFkOwner = null;
$this->aCcSubjsRelatedByDbEditedby = null; $this->aCcSubjsRelatedByDbEditedby = null;
$this->aCcMusicDirs = null; $this->aCcMusicDirs = null;

View file

@ -731,9 +731,9 @@ abstract class BaseCcFilesPeer
// Invalidate objects in ThirdPartyTrackReferencesPeer instance pool, // Invalidate objects in ThirdPartyTrackReferencesPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
ThirdPartyTrackReferencesPeer::clearInstancePool(); ThirdPartyTrackReferencesPeer::clearInstancePool();
// Invalidate objects in PodcastContentsPeer instance pool, // Invalidate objects in PodcastEpisodesPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
PodcastContentsPeer::clearInstancePool(); PodcastEpisodesPeer::clearInstancePool();
} }
/** /**

View file

@ -196,9 +196,9 @@
* @method CcFilesQuery rightJoinThirdPartyTrackReferences($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ThirdPartyTrackReferences relation * @method CcFilesQuery rightJoinThirdPartyTrackReferences($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ThirdPartyTrackReferences relation
* @method CcFilesQuery innerJoinThirdPartyTrackReferences($relationAlias = null) Adds a INNER JOIN clause to the query using the ThirdPartyTrackReferences relation * @method CcFilesQuery innerJoinThirdPartyTrackReferences($relationAlias = null) Adds a INNER JOIN clause to the query using the ThirdPartyTrackReferences relation
* *
* @method CcFilesQuery leftJoinPodcastContents($relationAlias = null) Adds a LEFT JOIN clause to the query using the PodcastContents relation * @method CcFilesQuery leftJoinPodcastEpisodes($relationAlias = null) Adds a LEFT JOIN clause to the query using the PodcastEpisodes relation
* @method CcFilesQuery rightJoinPodcastContents($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PodcastContents relation * @method CcFilesQuery rightJoinPodcastEpisodes($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PodcastEpisodes relation
* @method CcFilesQuery innerJoinPodcastContents($relationAlias = null) Adds a INNER JOIN clause to the query using the PodcastContents relation * @method CcFilesQuery innerJoinPodcastEpisodes($relationAlias = null) Adds a INNER JOIN clause to the query using the PodcastEpisodes relation
* *
* @method CcFiles findOne(PropelPDO $con = null) Return the first CcFiles matching the query * @method CcFiles findOne(PropelPDO $con = null) Return the first CcFiles matching the query
* @method CcFiles findOneOrCreate(PropelPDO $con = null) Return the first CcFiles matching the query, or a new CcFiles object populated from the query conditions when no match is found * @method CcFiles findOneOrCreate(PropelPDO $con = null) Return the first CcFiles matching the query, or a new CcFiles object populated from the query conditions when no match is found
@ -3625,41 +3625,41 @@ abstract class BaseCcFilesQuery extends ModelCriteria
} }
/** /**
* Filter the query by a related PodcastContents object * Filter the query by a related PodcastEpisodes object
* *
* @param PodcastContents|PropelObjectCollection $podcastContents the related object to use as filter * @param PodcastEpisodes|PropelObjectCollection $podcastEpisodes the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return CcFilesQuery The current query, for fluid interface * @return CcFilesQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid. * @throws PropelException - if the provided filter is invalid.
*/ */
public function filterByPodcastContents($podcastContents, $comparison = null) public function filterByPodcastEpisodes($podcastEpisodes, $comparison = null)
{ {
if ($podcastContents instanceof PodcastContents) { if ($podcastEpisodes instanceof PodcastEpisodes) {
return $this return $this
->addUsingAlias(CcFilesPeer::ID, $podcastContents->getDbFileId(), $comparison); ->addUsingAlias(CcFilesPeer::ID, $podcastEpisodes->getDbFileId(), $comparison);
} elseif ($podcastContents instanceof PropelObjectCollection) { } elseif ($podcastEpisodes instanceof PropelObjectCollection) {
return $this return $this
->usePodcastContentsQuery() ->usePodcastEpisodesQuery()
->filterByPrimaryKeys($podcastContents->getPrimaryKeys()) ->filterByPrimaryKeys($podcastEpisodes->getPrimaryKeys())
->endUse(); ->endUse();
} else { } else {
throw new PropelException('filterByPodcastContents() only accepts arguments of type PodcastContents or PropelCollection'); throw new PropelException('filterByPodcastEpisodes() only accepts arguments of type PodcastEpisodes or PropelCollection');
} }
} }
/** /**
* Adds a JOIN clause to the query using the PodcastContents relation * Adds a JOIN clause to the query using the PodcastEpisodes relation
* *
* @param string $relationAlias optional alias for the relation * @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
* *
* @return CcFilesQuery The current query, for fluid interface * @return CcFilesQuery The current query, for fluid interface
*/ */
public function joinPodcastContents($relationAlias = null, $joinType = Criteria::INNER_JOIN) public function joinPodcastEpisodes($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{ {
$tableMap = $this->getTableMap(); $tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('PodcastContents'); $relationMap = $tableMap->getRelation('PodcastEpisodes');
// create a ModelJoin object for this join // create a ModelJoin object for this join
$join = new ModelJoin(); $join = new ModelJoin();
@ -3674,14 +3674,14 @@ abstract class BaseCcFilesQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias); $this->addJoinObject($join, $relationAlias);
} else { } else {
$this->addJoinObject($join, 'PodcastContents'); $this->addJoinObject($join, 'PodcastEpisodes');
} }
return $this; return $this;
} }
/** /**
* Use the PodcastContents relation PodcastContents object * Use the PodcastEpisodes relation PodcastEpisodes object
* *
* @see useQuery() * @see useQuery()
* *
@ -3689,13 +3689,13 @@ abstract class BaseCcFilesQuery extends ModelCriteria
* to be used as main alias in the secondary query * to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
* *
* @return PodcastContentsQuery A secondary query class using the current class as primary query * @return PodcastEpisodesQuery A secondary query class using the current class as primary query
*/ */
public function usePodcastContentsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) public function usePodcastEpisodesQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{ {
return $this return $this
->joinPodcastContents($relationAlias, $joinType) ->joinPodcastEpisodes($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'PodcastContents', 'PodcastContentsQuery'); ->useQuery($relationAlias ? $relationAlias : 'PodcastEpisodes', 'PodcastEpisodesQuery');
} }
/** /**

View file

@ -85,10 +85,10 @@ abstract class BasePodcast extends BaseObject implements Persistent
protected $aCcSubjs; protected $aCcSubjs;
/** /**
* @var PropelObjectCollection|PodcastContents[] Collection to store aggregation of PodcastContents objects. * @var PropelObjectCollection|PodcastEpisodes[] Collection to store aggregation of PodcastEpisodes objects.
*/ */
protected $collPodcastContentss; protected $collPodcastEpisodess;
protected $collPodcastContentssPartial; protected $collPodcastEpisodessPartial;
/** /**
* Flag to prevent endless save loop, if this object is referenced * Flag to prevent endless save loop, if this object is referenced
@ -114,7 +114,7 @@ abstract class BasePodcast extends BaseObject implements Persistent
* An array of objects scheduled for deletion. * An array of objects scheduled for deletion.
* @var PropelObjectCollection * @var PropelObjectCollection
*/ */
protected $podcastContentssScheduledForDeletion = null; protected $podcastEpisodessScheduledForDeletion = null;
/** /**
* Applies default values to this object. * Applies default values to this object.
@ -529,7 +529,7 @@ abstract class BasePodcast extends BaseObject implements Persistent
if ($deep) { // also de-associate any related objects? if ($deep) { // also de-associate any related objects?
$this->aCcSubjs = null; $this->aCcSubjs = null;
$this->collPodcastContentss = null; $this->collPodcastEpisodess = null;
} // if (deep) } // if (deep)
} }
@ -667,17 +667,17 @@ abstract class BasePodcast extends BaseObject implements Persistent
$this->resetModified(); $this->resetModified();
} }
if ($this->podcastContentssScheduledForDeletion !== null) { if ($this->podcastEpisodessScheduledForDeletion !== null) {
if (!$this->podcastContentssScheduledForDeletion->isEmpty()) { if (!$this->podcastEpisodessScheduledForDeletion->isEmpty()) {
PodcastContentsQuery::create() PodcastEpisodesQuery::create()
->filterByPrimaryKeys($this->podcastContentssScheduledForDeletion->getPrimaryKeys(false)) ->filterByPrimaryKeys($this->podcastEpisodessScheduledForDeletion->getPrimaryKeys(false))
->delete($con); ->delete($con);
$this->podcastContentssScheduledForDeletion = null; $this->podcastEpisodessScheduledForDeletion = null;
} }
} }
if ($this->collPodcastContentss !== null) { if ($this->collPodcastEpisodess !== null) {
foreach ($this->collPodcastContentss as $referrerFK) { foreach ($this->collPodcastEpisodess as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con); $affectedRows += $referrerFK->save($con);
} }
@ -883,8 +883,8 @@ abstract class BasePodcast extends BaseObject implements Persistent
} }
if ($this->collPodcastContentss !== null) { if ($this->collPodcastEpisodess !== null) {
foreach ($this->collPodcastContentss as $referrerFK) { foreach ($this->collPodcastEpisodess as $referrerFK) {
if (!$referrerFK->validate($columns)) { if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
} }
@ -997,8 +997,8 @@ abstract class BasePodcast extends BaseObject implements Persistent
if (null !== $this->aCcSubjs) { if (null !== $this->aCcSubjs) {
$result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
} }
if (null !== $this->collPodcastContentss) { if (null !== $this->collPodcastEpisodess) {
$result['PodcastContentss'] = $this->collPodcastContentss->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); $result['PodcastEpisodess'] = $this->collPodcastEpisodess->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
} }
} }
@ -1187,9 +1187,9 @@ abstract class BasePodcast extends BaseObject implements Persistent
// store object hash to prevent cycle // store object hash to prevent cycle
$this->startCopy = true; $this->startCopy = true;
foreach ($this->getPodcastContentss() as $relObj) { foreach ($this->getPodcastEpisodess() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addPodcastContents($relObj->copy($deepCopy)); $copyObj->addPodcastEpisodes($relObj->copy($deepCopy));
} }
} }
@ -1306,42 +1306,42 @@ abstract class BasePodcast extends BaseObject implements Persistent
*/ */
public function initRelation($relationName) public function initRelation($relationName)
{ {
if ('PodcastContents' == $relationName) { if ('PodcastEpisodes' == $relationName) {
$this->initPodcastContentss(); $this->initPodcastEpisodess();
} }
} }
/** /**
* Clears out the collPodcastContentss collection * Clears out the collPodcastEpisodess collection
* *
* This does not modify the database; however, it will remove any associated objects, causing * This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method. * them to be refetched by subsequent calls to accessor method.
* *
* @return Podcast The current object (for fluent API support) * @return Podcast The current object (for fluent API support)
* @see addPodcastContentss() * @see addPodcastEpisodess()
*/ */
public function clearPodcastContentss() public function clearPodcastEpisodess()
{ {
$this->collPodcastContentss = null; // important to set this to null since that means it is uninitialized $this->collPodcastEpisodess = null; // important to set this to null since that means it is uninitialized
$this->collPodcastContentssPartial = null; $this->collPodcastEpisodessPartial = null;
return $this; return $this;
} }
/** /**
* reset is the collPodcastContentss collection loaded partially * reset is the collPodcastEpisodess collection loaded partially
* *
* @return void * @return void
*/ */
public function resetPartialPodcastContentss($v = true) public function resetPartialPodcastEpisodess($v = true)
{ {
$this->collPodcastContentssPartial = $v; $this->collPodcastEpisodessPartial = $v;
} }
/** /**
* Initializes the collPodcastContentss collection. * Initializes the collPodcastEpisodess collection.
* *
* By default this just sets the collPodcastContentss collection to an empty array (like clearcollPodcastContentss()); * By default this just sets the collPodcastEpisodess collection to an empty array (like clearcollPodcastEpisodess());
* however, you may wish to override this method in your stub class to provide setting appropriate * 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. * to your application -- for example, setting the initial array to the values stored in database.
* *
@ -1350,17 +1350,17 @@ abstract class BasePodcast extends BaseObject implements Persistent
* *
* @return void * @return void
*/ */
public function initPodcastContentss($overrideExisting = true) public function initPodcastEpisodess($overrideExisting = true)
{ {
if (null !== $this->collPodcastContentss && !$overrideExisting) { if (null !== $this->collPodcastEpisodess && !$overrideExisting) {
return; return;
} }
$this->collPodcastContentss = new PropelObjectCollection(); $this->collPodcastEpisodess = new PropelObjectCollection();
$this->collPodcastContentss->setModel('PodcastContents'); $this->collPodcastEpisodess->setModel('PodcastEpisodes');
} }
/** /**
* Gets an array of PodcastContents objects which contain a foreign key that references this object. * Gets an array of PodcastEpisodes 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. * 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. * Otherwise the results are fetched from the database the first time, then cached.
@ -1370,107 +1370,107 @@ abstract class BasePodcast extends BaseObject implements Persistent
* *
* @param Criteria $criteria optional Criteria object to narrow the query * @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object * @param PropelPDO $con optional connection object
* @return PropelObjectCollection|PodcastContents[] List of PodcastContents objects * @return PropelObjectCollection|PodcastEpisodes[] List of PodcastEpisodes objects
* @throws PropelException * @throws PropelException
*/ */
public function getPodcastContentss($criteria = null, PropelPDO $con = null) public function getPodcastEpisodess($criteria = null, PropelPDO $con = null)
{ {
$partial = $this->collPodcastContentssPartial && !$this->isNew(); $partial = $this->collPodcastEpisodessPartial && !$this->isNew();
if (null === $this->collPodcastContentss || null !== $criteria || $partial) { if (null === $this->collPodcastEpisodess || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collPodcastContentss) { if ($this->isNew() && null === $this->collPodcastEpisodess) {
// return empty collection // return empty collection
$this->initPodcastContentss(); $this->initPodcastEpisodess();
} else { } else {
$collPodcastContentss = PodcastContentsQuery::create(null, $criteria) $collPodcastEpisodess = PodcastEpisodesQuery::create(null, $criteria)
->filterByPodcast($this) ->filterByPodcast($this)
->find($con); ->find($con);
if (null !== $criteria) { if (null !== $criteria) {
if (false !== $this->collPodcastContentssPartial && count($collPodcastContentss)) { if (false !== $this->collPodcastEpisodessPartial && count($collPodcastEpisodess)) {
$this->initPodcastContentss(false); $this->initPodcastEpisodess(false);
foreach ($collPodcastContentss as $obj) { foreach ($collPodcastEpisodess as $obj) {
if (false == $this->collPodcastContentss->contains($obj)) { if (false == $this->collPodcastEpisodess->contains($obj)) {
$this->collPodcastContentss->append($obj); $this->collPodcastEpisodess->append($obj);
} }
} }
$this->collPodcastContentssPartial = true; $this->collPodcastEpisodessPartial = true;
} }
$collPodcastContentss->getInternalIterator()->rewind(); $collPodcastEpisodess->getInternalIterator()->rewind();
return $collPodcastContentss; return $collPodcastEpisodess;
} }
if ($partial && $this->collPodcastContentss) { if ($partial && $this->collPodcastEpisodess) {
foreach ($this->collPodcastContentss as $obj) { foreach ($this->collPodcastEpisodess as $obj) {
if ($obj->isNew()) { if ($obj->isNew()) {
$collPodcastContentss[] = $obj; $collPodcastEpisodess[] = $obj;
} }
} }
} }
$this->collPodcastContentss = $collPodcastContentss; $this->collPodcastEpisodess = $collPodcastEpisodess;
$this->collPodcastContentssPartial = false; $this->collPodcastEpisodessPartial = false;
} }
} }
return $this->collPodcastContentss; return $this->collPodcastEpisodess;
} }
/** /**
* Sets a collection of PodcastContents objects related by a one-to-many relationship * Sets a collection of PodcastEpisodes objects related by a one-to-many relationship
* to the current object. * to the current object.
* It will also schedule objects for deletion based on a diff between old objects (aka persisted) * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
* and new objects from the given Propel collection. * and new objects from the given Propel collection.
* *
* @param PropelCollection $podcastContentss A Propel collection. * @param PropelCollection $podcastEpisodess A Propel collection.
* @param PropelPDO $con Optional connection object * @param PropelPDO $con Optional connection object
* @return Podcast The current object (for fluent API support) * @return Podcast The current object (for fluent API support)
*/ */
public function setPodcastContentss(PropelCollection $podcastContentss, PropelPDO $con = null) public function setPodcastEpisodess(PropelCollection $podcastEpisodess, PropelPDO $con = null)
{ {
$podcastContentssToDelete = $this->getPodcastContentss(new Criteria(), $con)->diff($podcastContentss); $podcastEpisodessToDelete = $this->getPodcastEpisodess(new Criteria(), $con)->diff($podcastEpisodess);
$this->podcastContentssScheduledForDeletion = $podcastContentssToDelete; $this->podcastEpisodessScheduledForDeletion = $podcastEpisodessToDelete;
foreach ($podcastContentssToDelete as $podcastContentsRemoved) { foreach ($podcastEpisodessToDelete as $podcastEpisodesRemoved) {
$podcastContentsRemoved->setPodcast(null); $podcastEpisodesRemoved->setPodcast(null);
} }
$this->collPodcastContentss = null; $this->collPodcastEpisodess = null;
foreach ($podcastContentss as $podcastContents) { foreach ($podcastEpisodess as $podcastEpisodes) {
$this->addPodcastContents($podcastContents); $this->addPodcastEpisodes($podcastEpisodes);
} }
$this->collPodcastContentss = $podcastContentss; $this->collPodcastEpisodess = $podcastEpisodess;
$this->collPodcastContentssPartial = false; $this->collPodcastEpisodessPartial = false;
return $this; return $this;
} }
/** /**
* Returns the number of related PodcastContents objects. * Returns the number of related PodcastEpisodes objects.
* *
* @param Criteria $criteria * @param Criteria $criteria
* @param boolean $distinct * @param boolean $distinct
* @param PropelPDO $con * @param PropelPDO $con
* @return int Count of related PodcastContents objects. * @return int Count of related PodcastEpisodes objects.
* @throws PropelException * @throws PropelException
*/ */
public function countPodcastContentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) public function countPodcastEpisodess(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{ {
$partial = $this->collPodcastContentssPartial && !$this->isNew(); $partial = $this->collPodcastEpisodessPartial && !$this->isNew();
if (null === $this->collPodcastContentss || null !== $criteria || $partial) { if (null === $this->collPodcastEpisodess || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collPodcastContentss) { if ($this->isNew() && null === $this->collPodcastEpisodess) {
return 0; return 0;
} }
if ($partial && !$criteria) { if ($partial && !$criteria) {
return count($this->getPodcastContentss()); return count($this->getPodcastEpisodess());
} }
$query = PodcastContentsQuery::create(null, $criteria); $query = PodcastEpisodesQuery::create(null, $criteria);
if ($distinct) { if ($distinct) {
$query->distinct(); $query->distinct();
} }
@ -1480,28 +1480,28 @@ abstract class BasePodcast extends BaseObject implements Persistent
->count($con); ->count($con);
} }
return count($this->collPodcastContentss); return count($this->collPodcastEpisodess);
} }
/** /**
* Method called to associate a PodcastContents object to this object * Method called to associate a PodcastEpisodes object to this object
* through the PodcastContents foreign key attribute. * through the PodcastEpisodes foreign key attribute.
* *
* @param PodcastContents $l PodcastContents * @param PodcastEpisodes $l PodcastEpisodes
* @return Podcast The current object (for fluent API support) * @return Podcast The current object (for fluent API support)
*/ */
public function addPodcastContents(PodcastContents $l) public function addPodcastEpisodes(PodcastEpisodes $l)
{ {
if ($this->collPodcastContentss === null) { if ($this->collPodcastEpisodess === null) {
$this->initPodcastContentss(); $this->initPodcastEpisodess();
$this->collPodcastContentssPartial = true; $this->collPodcastEpisodessPartial = true;
} }
if (!in_array($l, $this->collPodcastContentss->getArrayCopy(), true)) { // only add it if the **same** object is not already associated if (!in_array($l, $this->collPodcastEpisodess->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddPodcastContents($l); $this->doAddPodcastEpisodes($l);
if ($this->podcastContentssScheduledForDeletion and $this->podcastContentssScheduledForDeletion->contains($l)) { if ($this->podcastEpisodessScheduledForDeletion and $this->podcastEpisodessScheduledForDeletion->contains($l)) {
$this->podcastContentssScheduledForDeletion->remove($this->podcastContentssScheduledForDeletion->search($l)); $this->podcastEpisodessScheduledForDeletion->remove($this->podcastEpisodessScheduledForDeletion->search($l));
} }
} }
@ -1509,28 +1509,28 @@ abstract class BasePodcast extends BaseObject implements Persistent
} }
/** /**
* @param PodcastContents $podcastContents The podcastContents object to add. * @param PodcastEpisodes $podcastEpisodes The podcastEpisodes object to add.
*/ */
protected function doAddPodcastContents($podcastContents) protected function doAddPodcastEpisodes($podcastEpisodes)
{ {
$this->collPodcastContentss[]= $podcastContents; $this->collPodcastEpisodess[]= $podcastEpisodes;
$podcastContents->setPodcast($this); $podcastEpisodes->setPodcast($this);
} }
/** /**
* @param PodcastContents $podcastContents The podcastContents object to remove. * @param PodcastEpisodes $podcastEpisodes The podcastEpisodes object to remove.
* @return Podcast The current object (for fluent API support) * @return Podcast The current object (for fluent API support)
*/ */
public function removePodcastContents($podcastContents) public function removePodcastEpisodes($podcastEpisodes)
{ {
if ($this->getPodcastContentss()->contains($podcastContents)) { if ($this->getPodcastEpisodess()->contains($podcastEpisodes)) {
$this->collPodcastContentss->remove($this->collPodcastContentss->search($podcastContents)); $this->collPodcastEpisodess->remove($this->collPodcastEpisodess->search($podcastEpisodes));
if (null === $this->podcastContentssScheduledForDeletion) { if (null === $this->podcastEpisodessScheduledForDeletion) {
$this->podcastContentssScheduledForDeletion = clone $this->collPodcastContentss; $this->podcastEpisodessScheduledForDeletion = clone $this->collPodcastEpisodess;
$this->podcastContentssScheduledForDeletion->clear(); $this->podcastEpisodessScheduledForDeletion->clear();
} }
$this->podcastContentssScheduledForDeletion[]= clone $podcastContents; $this->podcastEpisodessScheduledForDeletion[]= clone $podcastEpisodes;
$podcastContents->setPodcast(null); $podcastEpisodes->setPodcast(null);
} }
return $this; return $this;
@ -1542,7 +1542,7 @@ abstract class BasePodcast extends BaseObject implements Persistent
* an identical criteria, it returns the collection. * an identical criteria, it returns the collection.
* Otherwise if this Podcast is new, it will return * Otherwise if this Podcast is new, it will return
* an empty collection; or if this Podcast has previously * an empty collection; or if this Podcast has previously
* been saved, it will retrieve related PodcastContentss from storage. * been saved, it will retrieve related PodcastEpisodess from storage.
* *
* This method is protected by default in order to keep the public * This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you * api reasonable. You can provide public methods for those you
@ -1551,14 +1551,14 @@ abstract class BasePodcast extends BaseObject implements Persistent
* @param Criteria $criteria optional Criteria object to narrow the query * @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object * @param PropelPDO $con optional connection object
* @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return PropelObjectCollection|PodcastContents[] List of PodcastContents objects * @return PropelObjectCollection|PodcastEpisodes[] List of PodcastEpisodes objects
*/ */
public function getPodcastContentssJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) public function getPodcastEpisodessJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{ {
$query = PodcastContentsQuery::create(null, $criteria); $query = PodcastEpisodesQuery::create(null, $criteria);
$query->joinWith('CcFiles', $join_behavior); $query->joinWith('CcFiles', $join_behavior);
return $this->getPodcastContentss($query, $con); return $this->getPodcastEpisodess($query, $con);
} }
/** /**
@ -1597,8 +1597,8 @@ abstract class BasePodcast extends BaseObject implements Persistent
{ {
if ($deep && !$this->alreadyInClearAllReferencesDeep) { if ($deep && !$this->alreadyInClearAllReferencesDeep) {
$this->alreadyInClearAllReferencesDeep = true; $this->alreadyInClearAllReferencesDeep = true;
if ($this->collPodcastContentss) { if ($this->collPodcastEpisodess) {
foreach ($this->collPodcastContentss as $o) { foreach ($this->collPodcastEpisodess as $o) {
$o->clearAllReferences($deep); $o->clearAllReferences($deep);
} }
} }
@ -1609,10 +1609,10 @@ abstract class BasePodcast extends BaseObject implements Persistent
$this->alreadyInClearAllReferencesDeep = false; $this->alreadyInClearAllReferencesDeep = false;
} // if ($deep) } // if ($deep)
if ($this->collPodcastContentss instanceof PropelCollection) { if ($this->collPodcastEpisodess instanceof PropelCollection) {
$this->collPodcastContentss->clearIterator(); $this->collPodcastEpisodess->clearIterator();
} }
$this->collPodcastContentss = null; $this->collPodcastEpisodess = null;
$this->aCcSubjs = null; $this->aCcSubjs = null;
} }

View file

@ -2,24 +2,24 @@
/** /**
* Base class that represents a row from the 'podcast_contents' table. * Base class that represents a row from the 'podcast_episodes' table.
* *
* *
* *
* @package propel.generator.airtime.om * @package propel.generator.airtime.om
*/ */
abstract class BasePodcastContents extends BaseObject implements Persistent abstract class BasePodcastEpisodes extends BaseObject implements Persistent
{ {
/** /**
* Peer class name * Peer class name
*/ */
const PEER = 'PodcastContentsPeer'; const PEER = 'PodcastEpisodesPeer';
/** /**
* The Peer class. * The Peer class.
* Instance provides a convenient way of calling static methods on a class * Instance provides a convenient way of calling static methods on a class
* that calling code may not be able to identify. * that calling code may not be able to identify.
* @var PodcastContentsPeer * @var PodcastEpisodesPeer
*/ */
protected static $peer; protected static $peer;
@ -53,6 +53,18 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
*/ */
protected $publication_date; protected $publication_date;
/**
* The value for the download_url field.
* @var string
*/
protected $download_url;
/**
* The value for the episode_guid field.
* @var string
*/
protected $episode_guid;
/** /**
* @var CcFiles * @var CcFiles
*/ */
@ -151,11 +163,33 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
} }
/**
* Get the [download_url] column value.
*
* @return string
*/
public function getDbDownloadUrl()
{
return $this->download_url;
}
/**
* Get the [episode_guid] column value.
*
* @return string
*/
public function getDbEpisodeGuid()
{
return $this->episode_guid;
}
/** /**
* Set the value of [id] column. * Set the value of [id] column.
* *
* @param int $v new value * @param int $v new value
* @return PodcastContents The current object (for fluent API support) * @return PodcastEpisodes The current object (for fluent API support)
*/ */
public function setDbId($v) public function setDbId($v)
{ {
@ -165,7 +199,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
if ($this->id !== $v) { if ($this->id !== $v) {
$this->id = $v; $this->id = $v;
$this->modifiedColumns[] = PodcastContentsPeer::ID; $this->modifiedColumns[] = PodcastEpisodesPeer::ID;
} }
@ -176,7 +210,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
* Set the value of [file_id] column. * Set the value of [file_id] column.
* *
* @param int $v new value * @param int $v new value
* @return PodcastContents The current object (for fluent API support) * @return PodcastEpisodes The current object (for fluent API support)
*/ */
public function setDbFileId($v) public function setDbFileId($v)
{ {
@ -186,7 +220,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
if ($this->file_id !== $v) { if ($this->file_id !== $v) {
$this->file_id = $v; $this->file_id = $v;
$this->modifiedColumns[] = PodcastContentsPeer::FILE_ID; $this->modifiedColumns[] = PodcastEpisodesPeer::FILE_ID;
} }
if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) { if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) {
@ -201,7 +235,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
* Set the value of [podcast_id] column. * Set the value of [podcast_id] column.
* *
* @param int $v new value * @param int $v new value
* @return PodcastContents The current object (for fluent API support) * @return PodcastEpisodes The current object (for fluent API support)
*/ */
public function setDbPodcastId($v) public function setDbPodcastId($v)
{ {
@ -211,7 +245,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
if ($this->podcast_id !== $v) { if ($this->podcast_id !== $v) {
$this->podcast_id = $v; $this->podcast_id = $v;
$this->modifiedColumns[] = PodcastContentsPeer::PODCAST_ID; $this->modifiedColumns[] = PodcastEpisodesPeer::PODCAST_ID;
} }
if ($this->aPodcast !== null && $this->aPodcast->getDbId() !== $v) { if ($this->aPodcast !== null && $this->aPodcast->getDbId() !== $v) {
@ -227,7 +261,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
* *
* @param mixed $v string, integer (timestamp), or DateTime value. * @param mixed $v string, integer (timestamp), or DateTime value.
* Empty strings are treated as null. * Empty strings are treated as null.
* @return PodcastContents The current object (for fluent API support) * @return PodcastEpisodes The current object (for fluent API support)
*/ */
public function setDbPublicationDate($v) public function setDbPublicationDate($v)
{ {
@ -237,7 +271,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
$newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;
if ($currentDateAsString !== $newDateAsString) { if ($currentDateAsString !== $newDateAsString) {
$this->publication_date = $newDateAsString; $this->publication_date = $newDateAsString;
$this->modifiedColumns[] = PodcastContentsPeer::PUBLICATION_DATE; $this->modifiedColumns[] = PodcastEpisodesPeer::PUBLICATION_DATE;
} }
} // if either are not null } // if either are not null
@ -245,6 +279,48 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
return $this; return $this;
} // setDbPublicationDate() } // setDbPublicationDate()
/**
* Set the value of [download_url] column.
*
* @param string $v new value
* @return PodcastEpisodes The current object (for fluent API support)
*/
public function setDbDownloadUrl($v)
{
if ($v !== null && is_numeric($v)) {
$v = (string) $v;
}
if ($this->download_url !== $v) {
$this->download_url = $v;
$this->modifiedColumns[] = PodcastEpisodesPeer::DOWNLOAD_URL;
}
return $this;
} // setDbDownloadUrl()
/**
* Set the value of [episode_guid] column.
*
* @param string $v new value
* @return PodcastEpisodes The current object (for fluent API support)
*/
public function setDbEpisodeGuid($v)
{
if ($v !== null && is_numeric($v)) {
$v = (string) $v;
}
if ($this->episode_guid !== $v) {
$this->episode_guid = $v;
$this->modifiedColumns[] = PodcastEpisodesPeer::EPISODE_GUID;
}
return $this;
} // setDbEpisodeGuid()
/** /**
* Indicates whether the columns in this object are only set to default values. * Indicates whether the columns in this object are only set to default values.
* *
@ -281,6 +357,8 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
$this->file_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; $this->file_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->podcast_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; $this->podcast_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
$this->publication_date = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; $this->publication_date = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->download_url = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->episode_guid = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
$this->resetModified(); $this->resetModified();
$this->setNew(false); $this->setNew(false);
@ -290,10 +368,10 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
} }
$this->postHydrate($row, $startcol, $rehydrate); $this->postHydrate($row, $startcol, $rehydrate);
return $startcol + 4; // 4 = PodcastContentsPeer::NUM_HYDRATE_COLUMNS. return $startcol + 6; // 6 = PodcastEpisodesPeer::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating PodcastContents object", $e); throw new PropelException("Error populating PodcastEpisodes object", $e);
} }
} }
@ -342,13 +420,13 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
} }
if ($con === null) { if ($con === null) {
$con = Propel::getConnection(PodcastContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); $con = Propel::getConnection(PodcastEpisodesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
} }
// We don't need to alter the object instance pool; we're just modifying this instance // We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool. // already in the pool.
$stmt = PodcastContentsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); $stmt = PodcastEpisodesPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
$row = $stmt->fetch(PDO::FETCH_NUM); $row = $stmt->fetch(PDO::FETCH_NUM);
$stmt->closeCursor(); $stmt->closeCursor();
if (!$row) { if (!$row) {
@ -380,12 +458,12 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
} }
if ($con === null) { if ($con === null) {
$con = Propel::getConnection(PodcastContentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); $con = Propel::getConnection(PodcastEpisodesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
} }
$con->beginTransaction(); $con->beginTransaction();
try { try {
$deleteQuery = PodcastContentsQuery::create() $deleteQuery = PodcastEpisodesQuery::create()
->filterByPrimaryKey($this->getPrimaryKey()); ->filterByPrimaryKey($this->getPrimaryKey());
$ret = $this->preDelete($con); $ret = $this->preDelete($con);
if ($ret) { if ($ret) {
@ -423,7 +501,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
} }
if ($con === null) { if ($con === null) {
$con = Propel::getConnection(PodcastContentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); $con = Propel::getConnection(PodcastEpisodesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
} }
$con->beginTransaction(); $con->beginTransaction();
@ -443,7 +521,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
$this->postUpdate($con); $this->postUpdate($con);
} }
$this->postSave($con); $this->postSave($con);
PodcastContentsPeer::addInstanceToPool($this); PodcastEpisodesPeer::addInstanceToPool($this);
} else { } else {
$affectedRows = 0; $affectedRows = 0;
} }
@ -523,13 +601,13 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
$modifiedColumns = array(); $modifiedColumns = array();
$index = 0; $index = 0;
$this->modifiedColumns[] = PodcastContentsPeer::ID; $this->modifiedColumns[] = PodcastEpisodesPeer::ID;
if (null !== $this->id) { if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . PodcastContentsPeer::ID . ')'); throw new PropelException('Cannot insert a value for auto-increment primary key (' . PodcastEpisodesPeer::ID . ')');
} }
if (null === $this->id) { if (null === $this->id) {
try { try {
$stmt = $con->query("SELECT nextval('podcast_contents_id_seq')"); $stmt = $con->query("SELECT nextval('podcast_episodes_id_seq')");
$row = $stmt->fetch(PDO::FETCH_NUM); $row = $stmt->fetch(PDO::FETCH_NUM);
$this->id = $row[0]; $this->id = $row[0];
} catch (Exception $e) { } catch (Exception $e) {
@ -539,21 +617,27 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(PodcastContentsPeer::ID)) { if ($this->isColumnModified(PodcastEpisodesPeer::ID)) {
$modifiedColumns[':p' . $index++] = '"id"'; $modifiedColumns[':p' . $index++] = '"id"';
} }
if ($this->isColumnModified(PodcastContentsPeer::FILE_ID)) { if ($this->isColumnModified(PodcastEpisodesPeer::FILE_ID)) {
$modifiedColumns[':p' . $index++] = '"file_id"'; $modifiedColumns[':p' . $index++] = '"file_id"';
} }
if ($this->isColumnModified(PodcastContentsPeer::PODCAST_ID)) { if ($this->isColumnModified(PodcastEpisodesPeer::PODCAST_ID)) {
$modifiedColumns[':p' . $index++] = '"podcast_id"'; $modifiedColumns[':p' . $index++] = '"podcast_id"';
} }
if ($this->isColumnModified(PodcastContentsPeer::PUBLICATION_DATE)) { if ($this->isColumnModified(PodcastEpisodesPeer::PUBLICATION_DATE)) {
$modifiedColumns[':p' . $index++] = '"publication_date"'; $modifiedColumns[':p' . $index++] = '"publication_date"';
} }
if ($this->isColumnModified(PodcastEpisodesPeer::DOWNLOAD_URL)) {
$modifiedColumns[':p' . $index++] = '"download_url"';
}
if ($this->isColumnModified(PodcastEpisodesPeer::EPISODE_GUID)) {
$modifiedColumns[':p' . $index++] = '"episode_guid"';
}
$sql = sprintf( $sql = sprintf(
'INSERT INTO "podcast_contents" (%s) VALUES (%s)', 'INSERT INTO "podcast_episodes" (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@ -574,6 +658,12 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
case '"publication_date"': case '"publication_date"':
$stmt->bindValue($identifier, $this->publication_date, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->publication_date, PDO::PARAM_STR);
break; break;
case '"download_url"':
$stmt->bindValue($identifier, $this->download_url, PDO::PARAM_STR);
break;
case '"episode_guid"':
$stmt->bindValue($identifier, $this->episode_guid, PDO::PARAM_STR);
break;
} }
} }
$stmt->execute(); $stmt->execute();
@ -679,7 +769,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
} }
if (($retval = PodcastContentsPeer::doValidate($this, $columns)) !== true) { if (($retval = PodcastEpisodesPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval); $failureMap = array_merge($failureMap, $retval);
} }
@ -703,7 +793,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
*/ */
public function getByName($name, $type = BasePeer::TYPE_PHPNAME) public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{ {
$pos = PodcastContentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); $pos = PodcastEpisodesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$field = $this->getByPosition($pos); $field = $this->getByPosition($pos);
return $field; return $field;
@ -731,6 +821,12 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
case 3: case 3:
return $this->getDbPublicationDate(); return $this->getDbPublicationDate();
break; break;
case 4:
return $this->getDbDownloadUrl();
break;
case 5:
return $this->getDbEpisodeGuid();
break;
default: default:
return null; return null;
break; break;
@ -754,16 +850,18 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
*/ */
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{ {
if (isset($alreadyDumpedObjects['PodcastContents'][$this->getPrimaryKey()])) { if (isset($alreadyDumpedObjects['PodcastEpisodes'][$this->getPrimaryKey()])) {
return '*RECURSION*'; return '*RECURSION*';
} }
$alreadyDumpedObjects['PodcastContents'][$this->getPrimaryKey()] = true; $alreadyDumpedObjects['PodcastEpisodes'][$this->getPrimaryKey()] = true;
$keys = PodcastContentsPeer::getFieldNames($keyType); $keys = PodcastEpisodesPeer::getFieldNames($keyType);
$result = array( $result = array(
$keys[0] => $this->getDbId(), $keys[0] => $this->getDbId(),
$keys[1] => $this->getDbFileId(), $keys[1] => $this->getDbFileId(),
$keys[2] => $this->getDbPodcastId(), $keys[2] => $this->getDbPodcastId(),
$keys[3] => $this->getDbPublicationDate(), $keys[3] => $this->getDbPublicationDate(),
$keys[4] => $this->getDbDownloadUrl(),
$keys[5] => $this->getDbEpisodeGuid(),
); );
$virtualColumns = $this->virtualColumns; $virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) { foreach ($virtualColumns as $key => $virtualColumn) {
@ -795,7 +893,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
*/ */
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{ {
$pos = PodcastContentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); $pos = PodcastEpisodesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$this->setByPosition($pos, $value); $this->setByPosition($pos, $value);
} }
@ -823,6 +921,12 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
case 3: case 3:
$this->setDbPublicationDate($value); $this->setDbPublicationDate($value);
break; break;
case 4:
$this->setDbDownloadUrl($value);
break;
case 5:
$this->setDbEpisodeGuid($value);
break;
} // switch() } // switch()
} }
@ -845,12 +949,14 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
*/ */
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{ {
$keys = PodcastContentsPeer::getFieldNames($keyType); $keys = PodcastEpisodesPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDbFileId($arr[$keys[1]]); if (array_key_exists($keys[1], $arr)) $this->setDbFileId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbPodcastId($arr[$keys[2]]); if (array_key_exists($keys[2], $arr)) $this->setDbPodcastId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbPublicationDate($arr[$keys[3]]); if (array_key_exists($keys[3], $arr)) $this->setDbPublicationDate($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbDownloadUrl($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbEpisodeGuid($arr[$keys[5]]);
} }
/** /**
@ -860,12 +966,14 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
*/ */
public function buildCriteria() public function buildCriteria()
{ {
$criteria = new Criteria(PodcastContentsPeer::DATABASE_NAME); $criteria = new Criteria(PodcastEpisodesPeer::DATABASE_NAME);
if ($this->isColumnModified(PodcastContentsPeer::ID)) $criteria->add(PodcastContentsPeer::ID, $this->id); if ($this->isColumnModified(PodcastEpisodesPeer::ID)) $criteria->add(PodcastEpisodesPeer::ID, $this->id);
if ($this->isColumnModified(PodcastContentsPeer::FILE_ID)) $criteria->add(PodcastContentsPeer::FILE_ID, $this->file_id); if ($this->isColumnModified(PodcastEpisodesPeer::FILE_ID)) $criteria->add(PodcastEpisodesPeer::FILE_ID, $this->file_id);
if ($this->isColumnModified(PodcastContentsPeer::PODCAST_ID)) $criteria->add(PodcastContentsPeer::PODCAST_ID, $this->podcast_id); if ($this->isColumnModified(PodcastEpisodesPeer::PODCAST_ID)) $criteria->add(PodcastEpisodesPeer::PODCAST_ID, $this->podcast_id);
if ($this->isColumnModified(PodcastContentsPeer::PUBLICATION_DATE)) $criteria->add(PodcastContentsPeer::PUBLICATION_DATE, $this->publication_date); if ($this->isColumnModified(PodcastEpisodesPeer::PUBLICATION_DATE)) $criteria->add(PodcastEpisodesPeer::PUBLICATION_DATE, $this->publication_date);
if ($this->isColumnModified(PodcastEpisodesPeer::DOWNLOAD_URL)) $criteria->add(PodcastEpisodesPeer::DOWNLOAD_URL, $this->download_url);
if ($this->isColumnModified(PodcastEpisodesPeer::EPISODE_GUID)) $criteria->add(PodcastEpisodesPeer::EPISODE_GUID, $this->episode_guid);
return $criteria; return $criteria;
} }
@ -880,8 +988,8 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
*/ */
public function buildPkeyCriteria() public function buildPkeyCriteria()
{ {
$criteria = new Criteria(PodcastContentsPeer::DATABASE_NAME); $criteria = new Criteria(PodcastEpisodesPeer::DATABASE_NAME);
$criteria->add(PodcastContentsPeer::ID, $this->id); $criteria->add(PodcastEpisodesPeer::ID, $this->id);
return $criteria; return $criteria;
} }
@ -922,7 +1030,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
* If desired, this method can also make copies of all associated (fkey referrers) * If desired, this method can also make copies of all associated (fkey referrers)
* objects. * objects.
* *
* @param object $copyObj An object of PodcastContents (or compatible) type. * @param object $copyObj An object of PodcastEpisodes (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new. * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
* @throws PropelException * @throws PropelException
@ -932,6 +1040,8 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
$copyObj->setDbFileId($this->getDbFileId()); $copyObj->setDbFileId($this->getDbFileId());
$copyObj->setDbPodcastId($this->getDbPodcastId()); $copyObj->setDbPodcastId($this->getDbPodcastId());
$copyObj->setDbPublicationDate($this->getDbPublicationDate()); $copyObj->setDbPublicationDate($this->getDbPublicationDate());
$copyObj->setDbDownloadUrl($this->getDbDownloadUrl());
$copyObj->setDbEpisodeGuid($this->getDbEpisodeGuid());
if ($deepCopy && !$this->startCopy) { if ($deepCopy && !$this->startCopy) {
// important: temporarily setNew(false) because this affects the behavior of // important: temporarily setNew(false) because this affects the behavior of
@ -959,7 +1069,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
* objects. * objects.
* *
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return PodcastContents Clone of current object. * @return PodcastEpisodes Clone of current object.
* @throws PropelException * @throws PropelException
*/ */
public function copy($deepCopy = false) public function copy($deepCopy = false)
@ -979,12 +1089,12 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
* same instance for all member of this class. The method could therefore * same instance for all member of this class. The method could therefore
* be static, but this would prevent one from overriding the behavior. * be static, but this would prevent one from overriding the behavior.
* *
* @return PodcastContentsPeer * @return PodcastEpisodesPeer
*/ */
public function getPeer() public function getPeer()
{ {
if (self::$peer === null) { if (self::$peer === null) {
self::$peer = new PodcastContentsPeer(); self::$peer = new PodcastEpisodesPeer();
} }
return self::$peer; return self::$peer;
@ -994,7 +1104,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
* Declares an association between this object and a CcFiles object. * Declares an association between this object and a CcFiles object.
* *
* @param CcFiles $v * @param CcFiles $v
* @return PodcastContents The current object (for fluent API support) * @return PodcastEpisodes The current object (for fluent API support)
* @throws PropelException * @throws PropelException
*/ */
public function setCcFiles(CcFiles $v = null) public function setCcFiles(CcFiles $v = null)
@ -1010,7 +1120,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
// Add binding for other direction of this n:n relationship. // Add binding for other direction of this n:n relationship.
// If this object has already been added to the CcFiles object, it will not be re-added. // If this object has already been added to the CcFiles object, it will not be re-added.
if ($v !== null) { if ($v !== null) {
$v->addPodcastContents($this); $v->addPodcastEpisodes($this);
} }
@ -1035,7 +1145,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
to this object. This level of coupling may, however, be to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection undesirable since it could result in an only partially populated collection
in the referenced object. in the referenced object.
$this->aCcFiles->addPodcastContentss($this); $this->aCcFiles->addPodcastEpisodess($this);
*/ */
} }
@ -1046,7 +1156,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
* Declares an association between this object and a Podcast object. * Declares an association between this object and a Podcast object.
* *
* @param Podcast $v * @param Podcast $v
* @return PodcastContents The current object (for fluent API support) * @return PodcastEpisodes The current object (for fluent API support)
* @throws PropelException * @throws PropelException
*/ */
public function setPodcast(Podcast $v = null) public function setPodcast(Podcast $v = null)
@ -1062,7 +1172,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
// Add binding for other direction of this n:n relationship. // Add binding for other direction of this n:n relationship.
// If this object has already been added to the Podcast object, it will not be re-added. // If this object has already been added to the Podcast object, it will not be re-added.
if ($v !== null) { if ($v !== null) {
$v->addPodcastContents($this); $v->addPodcastEpisodes($this);
} }
@ -1087,7 +1197,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
to this object. This level of coupling may, however, be to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection undesirable since it could result in an only partially populated collection
in the referenced object. in the referenced object.
$this->aPodcast->addPodcastContentss($this); $this->aPodcast->addPodcastEpisodess($this);
*/ */
} }
@ -1103,6 +1213,8 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
$this->file_id = null; $this->file_id = null;
$this->podcast_id = null; $this->podcast_id = null;
$this->publication_date = null; $this->publication_date = null;
$this->download_url = null;
$this->episode_guid = null;
$this->alreadyInSave = false; $this->alreadyInSave = false;
$this->alreadyInValidation = false; $this->alreadyInValidation = false;
$this->alreadyInClearAllReferencesDeep = false; $this->alreadyInClearAllReferencesDeep = false;
@ -1146,7 +1258,7 @@ abstract class BasePodcastContents extends BaseObject implements Persistent
*/ */
public function __toString() public function __toString()
{ {
return (string) $this->exportTo(PodcastContentsPeer::DEFAULT_STRING_FORMAT); return (string) $this->exportTo(PodcastEpisodesPeer::DEFAULT_STRING_FORMAT);
} }
/** /**

View file

@ -2,50 +2,58 @@
/** /**
* Base class that represents a query for the 'podcast_contents' table. * Base class that represents a query for the 'podcast_episodes' table.
* *
* *
* *
* @method PodcastContentsQuery orderByDbId($order = Criteria::ASC) Order by the id column * @method PodcastEpisodesQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method PodcastContentsQuery orderByDbFileId($order = Criteria::ASC) Order by the file_id column * @method PodcastEpisodesQuery orderByDbFileId($order = Criteria::ASC) Order by the file_id column
* @method PodcastContentsQuery orderByDbPodcastId($order = Criteria::ASC) Order by the podcast_id column * @method PodcastEpisodesQuery orderByDbPodcastId($order = Criteria::ASC) Order by the podcast_id column
* @method PodcastContentsQuery orderByDbPublicationDate($order = Criteria::ASC) Order by the publication_date column * @method PodcastEpisodesQuery orderByDbPublicationDate($order = Criteria::ASC) Order by the publication_date column
* @method PodcastEpisodesQuery orderByDbDownloadUrl($order = Criteria::ASC) Order by the download_url column
* @method PodcastEpisodesQuery orderByDbEpisodeGuid($order = Criteria::ASC) Order by the episode_guid column
* *
* @method PodcastContentsQuery groupByDbId() Group by the id column * @method PodcastEpisodesQuery groupByDbId() Group by the id column
* @method PodcastContentsQuery groupByDbFileId() Group by the file_id column * @method PodcastEpisodesQuery groupByDbFileId() Group by the file_id column
* @method PodcastContentsQuery groupByDbPodcastId() Group by the podcast_id column * @method PodcastEpisodesQuery groupByDbPodcastId() Group by the podcast_id column
* @method PodcastContentsQuery groupByDbPublicationDate() Group by the publication_date column * @method PodcastEpisodesQuery groupByDbPublicationDate() Group by the publication_date column
* @method PodcastEpisodesQuery groupByDbDownloadUrl() Group by the download_url column
* @method PodcastEpisodesQuery groupByDbEpisodeGuid() Group by the episode_guid column
* *
* @method PodcastContentsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query * @method PodcastEpisodesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method PodcastContentsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method PodcastEpisodesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method PodcastContentsQuery innerJoin($relation) Adds a INNER JOIN clause to the query * @method PodcastEpisodesQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* *
* @method PodcastContentsQuery leftJoinCcFiles($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcFiles relation * @method PodcastEpisodesQuery leftJoinCcFiles($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcFiles relation
* @method PodcastContentsQuery rightJoinCcFiles($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcFiles relation * @method PodcastEpisodesQuery rightJoinCcFiles($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcFiles relation
* @method PodcastContentsQuery innerJoinCcFiles($relationAlias = null) Adds a INNER JOIN clause to the query using the CcFiles relation * @method PodcastEpisodesQuery innerJoinCcFiles($relationAlias = null) Adds a INNER JOIN clause to the query using the CcFiles relation
* *
* @method PodcastContentsQuery leftJoinPodcast($relationAlias = null) Adds a LEFT JOIN clause to the query using the Podcast relation * @method PodcastEpisodesQuery leftJoinPodcast($relationAlias = null) Adds a LEFT JOIN clause to the query using the Podcast relation
* @method PodcastContentsQuery rightJoinPodcast($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Podcast relation * @method PodcastEpisodesQuery rightJoinPodcast($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Podcast relation
* @method PodcastContentsQuery innerJoinPodcast($relationAlias = null) Adds a INNER JOIN clause to the query using the Podcast relation * @method PodcastEpisodesQuery innerJoinPodcast($relationAlias = null) Adds a INNER JOIN clause to the query using the Podcast relation
* *
* @method PodcastContents findOne(PropelPDO $con = null) Return the first PodcastContents matching the query * @method PodcastEpisodes findOne(PropelPDO $con = null) Return the first PodcastEpisodes matching the query
* @method PodcastContents findOneOrCreate(PropelPDO $con = null) Return the first PodcastContents matching the query, or a new PodcastContents object populated from the query conditions when no match is found * @method PodcastEpisodes findOneOrCreate(PropelPDO $con = null) Return the first PodcastEpisodes matching the query, or a new PodcastEpisodes object populated from the query conditions when no match is found
* *
* @method PodcastContents findOneByDbFileId(int $file_id) Return the first PodcastContents filtered by the file_id column * @method PodcastEpisodes findOneByDbFileId(int $file_id) Return the first PodcastEpisodes filtered by the file_id column
* @method PodcastContents findOneByDbPodcastId(int $podcast_id) Return the first PodcastContents filtered by the podcast_id column * @method PodcastEpisodes findOneByDbPodcastId(int $podcast_id) Return the first PodcastEpisodes filtered by the podcast_id column
* @method PodcastContents findOneByDbPublicationDate(string $publication_date) Return the first PodcastContents filtered by the publication_date column * @method PodcastEpisodes findOneByDbPublicationDate(string $publication_date) Return the first PodcastEpisodes filtered by the publication_date column
* @method PodcastEpisodes findOneByDbDownloadUrl(string $download_url) Return the first PodcastEpisodes filtered by the download_url column
* @method PodcastEpisodes findOneByDbEpisodeGuid(string $episode_guid) Return the first PodcastEpisodes filtered by the episode_guid column
* *
* @method array findByDbId(int $id) Return PodcastContents objects filtered by the id column * @method array findByDbId(int $id) Return PodcastEpisodes objects filtered by the id column
* @method array findByDbFileId(int $file_id) Return PodcastContents objects filtered by the file_id column * @method array findByDbFileId(int $file_id) Return PodcastEpisodes objects filtered by the file_id column
* @method array findByDbPodcastId(int $podcast_id) Return PodcastContents objects filtered by the podcast_id column * @method array findByDbPodcastId(int $podcast_id) Return PodcastEpisodes objects filtered by the podcast_id column
* @method array findByDbPublicationDate(string $publication_date) Return PodcastContents objects filtered by the publication_date column * @method array findByDbPublicationDate(string $publication_date) Return PodcastEpisodes objects filtered by the publication_date column
* @method array findByDbDownloadUrl(string $download_url) Return PodcastEpisodes objects filtered by the download_url column
* @method array findByDbEpisodeGuid(string $episode_guid) Return PodcastEpisodes objects filtered by the episode_guid column
* *
* @package propel.generator.airtime.om * @package propel.generator.airtime.om
*/ */
abstract class BasePodcastContentsQuery extends ModelCriteria abstract class BasePodcastEpisodesQuery extends ModelCriteria
{ {
/** /**
* Initializes internal state of BasePodcastContentsQuery object. * Initializes internal state of BasePodcastEpisodesQuery object.
* *
* @param string $dbName The dabase name * @param string $dbName The dabase name
* @param string $modelName The phpName of a model, e.g. 'Book' * @param string $modelName The phpName of a model, e.g. 'Book'
@ -57,25 +65,25 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
$dbName = 'airtime'; $dbName = 'airtime';
} }
if (null === $modelName) { if (null === $modelName) {
$modelName = 'PodcastContents'; $modelName = 'PodcastEpisodes';
} }
parent::__construct($dbName, $modelName, $modelAlias); parent::__construct($dbName, $modelName, $modelAlias);
} }
/** /**
* Returns a new PodcastContentsQuery object. * Returns a new PodcastEpisodesQuery object.
* *
* @param string $modelAlias The alias of a model in the query * @param string $modelAlias The alias of a model in the query
* @param PodcastContentsQuery|Criteria $criteria Optional Criteria to build the query from * @param PodcastEpisodesQuery|Criteria $criteria Optional Criteria to build the query from
* *
* @return PodcastContentsQuery * @return PodcastEpisodesQuery
*/ */
public static function create($modelAlias = null, $criteria = null) public static function create($modelAlias = null, $criteria = null)
{ {
if ($criteria instanceof PodcastContentsQuery) { if ($criteria instanceof PodcastEpisodesQuery) {
return $criteria; return $criteria;
} }
$query = new PodcastContentsQuery(null, null, $modelAlias); $query = new PodcastEpisodesQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) { if ($criteria instanceof Criteria) {
$query->mergeWith($criteria); $query->mergeWith($criteria);
@ -96,19 +104,19 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query * @param mixed $key Primary key to use for the query
* @param PropelPDO $con an optional connection object * @param PropelPDO $con an optional connection object
* *
* @return PodcastContents|PodcastContents[]|mixed the result, formatted by the current formatter * @return PodcastEpisodes|PodcastEpisodes[]|mixed the result, formatted by the current formatter
*/ */
public function findPk($key, $con = null) public function findPk($key, $con = null)
{ {
if ($key === null) { if ($key === null) {
return null; return null;
} }
if ((null !== ($obj = PodcastContentsPeer::getInstanceFromPool((string) $key))) && !$this->formatter) { if ((null !== ($obj = PodcastEpisodesPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool // the object is already in the instance pool
return $obj; return $obj;
} }
if ($con === null) { if ($con === null) {
$con = Propel::getConnection(PodcastContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); $con = Propel::getConnection(PodcastEpisodesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
} }
$this->basePreSelect($con); $this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select if ($this->formatter || $this->modelAlias || $this->with || $this->select
@ -126,7 +134,7 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query * @param mixed $key Primary key to use for the query
* @param PropelPDO $con A connection object * @param PropelPDO $con A connection object
* *
* @return PodcastContents A model object, or null if the key is not found * @return PodcastEpisodes A model object, or null if the key is not found
* @throws PropelException * @throws PropelException
*/ */
public function findOneByDbId($key, $con = null) public function findOneByDbId($key, $con = null)
@ -141,12 +149,12 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query * @param mixed $key Primary key to use for the query
* @param PropelPDO $con A connection object * @param PropelPDO $con A connection object
* *
* @return PodcastContents A model object, or null if the key is not found * @return PodcastEpisodes A model object, or null if the key is not found
* @throws PropelException * @throws PropelException
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT "id", "file_id", "podcast_id", "publication_date" FROM "podcast_contents" WHERE "id" = :p0'; $sql = 'SELECT "id", "file_id", "podcast_id", "publication_date", "download_url", "episode_guid" FROM "podcast_episodes" WHERE "id" = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@ -157,9 +165,9 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
} }
$obj = null; $obj = null;
if ($row = $stmt->fetch(PDO::FETCH_NUM)) { if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$obj = new PodcastContents(); $obj = new PodcastEpisodes();
$obj->hydrate($row); $obj->hydrate($row);
PodcastContentsPeer::addInstanceToPool($obj, (string) $key); PodcastEpisodesPeer::addInstanceToPool($obj, (string) $key);
} }
$stmt->closeCursor(); $stmt->closeCursor();
@ -172,7 +180,7 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query * @param mixed $key Primary key to use for the query
* @param PropelPDO $con A connection object * @param PropelPDO $con A connection object
* *
* @return PodcastContents|PodcastContents[]|mixed the result, formatted by the current formatter * @return PodcastEpisodes|PodcastEpisodes[]|mixed the result, formatted by the current formatter
*/ */
protected function findPkComplex($key, $con) protected function findPkComplex($key, $con)
{ {
@ -193,7 +201,7 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* @param array $keys Primary keys to use for the query * @param array $keys Primary keys to use for the query
* @param PropelPDO $con an optional connection object * @param PropelPDO $con an optional connection object
* *
* @return PropelObjectCollection|PodcastContents[]|mixed the list of results, formatted by the current formatter * @return PropelObjectCollection|PodcastEpisodes[]|mixed the list of results, formatted by the current formatter
*/ */
public function findPks($keys, $con = null) public function findPks($keys, $con = null)
{ {
@ -214,12 +222,12 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* *
* @param mixed $key Primary key to use for the query * @param mixed $key Primary key to use for the query
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
*/ */
public function filterByPrimaryKey($key) public function filterByPrimaryKey($key)
{ {
return $this->addUsingAlias(PodcastContentsPeer::ID, $key, Criteria::EQUAL); return $this->addUsingAlias(PodcastEpisodesPeer::ID, $key, Criteria::EQUAL);
} }
/** /**
@ -227,12 +235,12 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* *
* @param array $keys The list of primary key to use for the query * @param array $keys The list of primary key to use for the query
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
*/ */
public function filterByPrimaryKeys($keys) public function filterByPrimaryKeys($keys)
{ {
return $this->addUsingAlias(PodcastContentsPeer::ID, $keys, Criteria::IN); return $this->addUsingAlias(PodcastEpisodesPeer::ID, $keys, Criteria::IN);
} }
/** /**
@ -252,18 +260,18 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
*/ */
public function filterByDbId($dbId = null, $comparison = null) public function filterByDbId($dbId = null, $comparison = null)
{ {
if (is_array($dbId)) { if (is_array($dbId)) {
$useMinMax = false; $useMinMax = false;
if (isset($dbId['min'])) { if (isset($dbId['min'])) {
$this->addUsingAlias(PodcastContentsPeer::ID, $dbId['min'], Criteria::GREATER_EQUAL); $this->addUsingAlias(PodcastEpisodesPeer::ID, $dbId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if (isset($dbId['max'])) { if (isset($dbId['max'])) {
$this->addUsingAlias(PodcastContentsPeer::ID, $dbId['max'], Criteria::LESS_EQUAL); $this->addUsingAlias(PodcastEpisodesPeer::ID, $dbId['max'], Criteria::LESS_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if ($useMinMax) { if ($useMinMax) {
@ -274,7 +282,7 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
} }
} }
return $this->addUsingAlias(PodcastContentsPeer::ID, $dbId, $comparison); return $this->addUsingAlias(PodcastEpisodesPeer::ID, $dbId, $comparison);
} }
/** /**
@ -296,18 +304,18 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
*/ */
public function filterByDbFileId($dbFileId = null, $comparison = null) public function filterByDbFileId($dbFileId = null, $comparison = null)
{ {
if (is_array($dbFileId)) { if (is_array($dbFileId)) {
$useMinMax = false; $useMinMax = false;
if (isset($dbFileId['min'])) { if (isset($dbFileId['min'])) {
$this->addUsingAlias(PodcastContentsPeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL); $this->addUsingAlias(PodcastEpisodesPeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if (isset($dbFileId['max'])) { if (isset($dbFileId['max'])) {
$this->addUsingAlias(PodcastContentsPeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL); $this->addUsingAlias(PodcastEpisodesPeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if ($useMinMax) { if ($useMinMax) {
@ -318,7 +326,7 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
} }
} }
return $this->addUsingAlias(PodcastContentsPeer::FILE_ID, $dbFileId, $comparison); return $this->addUsingAlias(PodcastEpisodesPeer::FILE_ID, $dbFileId, $comparison);
} }
/** /**
@ -340,18 +348,18 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
*/ */
public function filterByDbPodcastId($dbPodcastId = null, $comparison = null) public function filterByDbPodcastId($dbPodcastId = null, $comparison = null)
{ {
if (is_array($dbPodcastId)) { if (is_array($dbPodcastId)) {
$useMinMax = false; $useMinMax = false;
if (isset($dbPodcastId['min'])) { if (isset($dbPodcastId['min'])) {
$this->addUsingAlias(PodcastContentsPeer::PODCAST_ID, $dbPodcastId['min'], Criteria::GREATER_EQUAL); $this->addUsingAlias(PodcastEpisodesPeer::PODCAST_ID, $dbPodcastId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if (isset($dbPodcastId['max'])) { if (isset($dbPodcastId['max'])) {
$this->addUsingAlias(PodcastContentsPeer::PODCAST_ID, $dbPodcastId['max'], Criteria::LESS_EQUAL); $this->addUsingAlias(PodcastEpisodesPeer::PODCAST_ID, $dbPodcastId['max'], Criteria::LESS_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if ($useMinMax) { if ($useMinMax) {
@ -362,7 +370,7 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
} }
} }
return $this->addUsingAlias(PodcastContentsPeer::PODCAST_ID, $dbPodcastId, $comparison); return $this->addUsingAlias(PodcastEpisodesPeer::PODCAST_ID, $dbPodcastId, $comparison);
} }
/** /**
@ -383,18 +391,18 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
*/ */
public function filterByDbPublicationDate($dbPublicationDate = null, $comparison = null) public function filterByDbPublicationDate($dbPublicationDate = null, $comparison = null)
{ {
if (is_array($dbPublicationDate)) { if (is_array($dbPublicationDate)) {
$useMinMax = false; $useMinMax = false;
if (isset($dbPublicationDate['min'])) { if (isset($dbPublicationDate['min'])) {
$this->addUsingAlias(PodcastContentsPeer::PUBLICATION_DATE, $dbPublicationDate['min'], Criteria::GREATER_EQUAL); $this->addUsingAlias(PodcastEpisodesPeer::PUBLICATION_DATE, $dbPublicationDate['min'], Criteria::GREATER_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if (isset($dbPublicationDate['max'])) { if (isset($dbPublicationDate['max'])) {
$this->addUsingAlias(PodcastContentsPeer::PUBLICATION_DATE, $dbPublicationDate['max'], Criteria::LESS_EQUAL); $this->addUsingAlias(PodcastEpisodesPeer::PUBLICATION_DATE, $dbPublicationDate['max'], Criteria::LESS_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if ($useMinMax) { if ($useMinMax) {
@ -405,7 +413,65 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
} }
} }
return $this->addUsingAlias(PodcastContentsPeer::PUBLICATION_DATE, $dbPublicationDate, $comparison); return $this->addUsingAlias(PodcastEpisodesPeer::PUBLICATION_DATE, $dbPublicationDate, $comparison);
}
/**
* Filter the query on the download_url column
*
* Example usage:
* <code>
* $query->filterByDbDownloadUrl('fooValue'); // WHERE download_url = 'fooValue'
* $query->filterByDbDownloadUrl('%fooValue%'); // WHERE download_url LIKE '%fooValue%'
* </code>
*
* @param string $dbDownloadUrl The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return PodcastEpisodesQuery The current query, for fluid interface
*/
public function filterByDbDownloadUrl($dbDownloadUrl = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbDownloadUrl)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbDownloadUrl)) {
$dbDownloadUrl = str_replace('*', '%', $dbDownloadUrl);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PodcastEpisodesPeer::DOWNLOAD_URL, $dbDownloadUrl, $comparison);
}
/**
* Filter the query on the episode_guid column
*
* Example usage:
* <code>
* $query->filterByDbEpisodeGuid('fooValue'); // WHERE episode_guid = 'fooValue'
* $query->filterByDbEpisodeGuid('%fooValue%'); // WHERE episode_guid LIKE '%fooValue%'
* </code>
*
* @param string $dbEpisodeGuid The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return PodcastEpisodesQuery The current query, for fluid interface
*/
public function filterByDbEpisodeGuid($dbEpisodeGuid = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbEpisodeGuid)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbEpisodeGuid)) {
$dbEpisodeGuid = str_replace('*', '%', $dbEpisodeGuid);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PodcastEpisodesPeer::EPISODE_GUID, $dbEpisodeGuid, $comparison);
} }
/** /**
@ -414,21 +480,21 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* @param CcFiles|PropelObjectCollection $ccFiles The related object(s) to use as filter * @param CcFiles|PropelObjectCollection $ccFiles The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid. * @throws PropelException - if the provided filter is invalid.
*/ */
public function filterByCcFiles($ccFiles, $comparison = null) public function filterByCcFiles($ccFiles, $comparison = null)
{ {
if ($ccFiles instanceof CcFiles) { if ($ccFiles instanceof CcFiles) {
return $this return $this
->addUsingAlias(PodcastContentsPeer::FILE_ID, $ccFiles->getDbId(), $comparison); ->addUsingAlias(PodcastEpisodesPeer::FILE_ID, $ccFiles->getDbId(), $comparison);
} elseif ($ccFiles instanceof PropelObjectCollection) { } elseif ($ccFiles instanceof PropelObjectCollection) {
if (null === $comparison) { if (null === $comparison) {
$comparison = Criteria::IN; $comparison = Criteria::IN;
} }
return $this return $this
->addUsingAlias(PodcastContentsPeer::FILE_ID, $ccFiles->toKeyValue('PrimaryKey', 'DbId'), $comparison); ->addUsingAlias(PodcastEpisodesPeer::FILE_ID, $ccFiles->toKeyValue('PrimaryKey', 'DbId'), $comparison);
} else { } else {
throw new PropelException('filterByCcFiles() only accepts arguments of type CcFiles or PropelCollection'); throw new PropelException('filterByCcFiles() only accepts arguments of type CcFiles or PropelCollection');
} }
@ -440,7 +506,7 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* @param string $relationAlias optional alias for the relation * @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
*/ */
public function joinCcFiles($relationAlias = null, $joinType = Criteria::INNER_JOIN) public function joinCcFiles($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{ {
@ -490,21 +556,21 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* @param Podcast|PropelObjectCollection $podcast The related object(s) to use as filter * @param Podcast|PropelObjectCollection $podcast The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid. * @throws PropelException - if the provided filter is invalid.
*/ */
public function filterByPodcast($podcast, $comparison = null) public function filterByPodcast($podcast, $comparison = null)
{ {
if ($podcast instanceof Podcast) { if ($podcast instanceof Podcast) {
return $this return $this
->addUsingAlias(PodcastContentsPeer::PODCAST_ID, $podcast->getDbId(), $comparison); ->addUsingAlias(PodcastEpisodesPeer::PODCAST_ID, $podcast->getDbId(), $comparison);
} elseif ($podcast instanceof PropelObjectCollection) { } elseif ($podcast instanceof PropelObjectCollection) {
if (null === $comparison) { if (null === $comparison) {
$comparison = Criteria::IN; $comparison = Criteria::IN;
} }
return $this return $this
->addUsingAlias(PodcastContentsPeer::PODCAST_ID, $podcast->toKeyValue('PrimaryKey', 'DbId'), $comparison); ->addUsingAlias(PodcastEpisodesPeer::PODCAST_ID, $podcast->toKeyValue('PrimaryKey', 'DbId'), $comparison);
} else { } else {
throw new PropelException('filterByPodcast() only accepts arguments of type Podcast or PropelCollection'); throw new PropelException('filterByPodcast() only accepts arguments of type Podcast or PropelCollection');
} }
@ -516,7 +582,7 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
* @param string $relationAlias optional alias for the relation * @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
*/ */
public function joinPodcast($relationAlias = null, $joinType = Criteria::INNER_JOIN) public function joinPodcast($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{ {
@ -563,14 +629,14 @@ abstract class BasePodcastContentsQuery extends ModelCriteria
/** /**
* Exclude object from result * Exclude object from result
* *
* @param PodcastContents $podcastContents Object to remove from the list of results * @param PodcastEpisodes $podcastEpisodes Object to remove from the list of results
* *
* @return PodcastContentsQuery The current query, for fluid interface * @return PodcastEpisodesQuery The current query, for fluid interface
*/ */
public function prune($podcastContents = null) public function prune($podcastEpisodes = null)
{ {
if ($podcastContents) { if ($podcastEpisodes) {
$this->addUsingAlias(PodcastContentsPeer::ID, $podcastContents->getDbId(), Criteria::NOT_EQUAL); $this->addUsingAlias(PodcastEpisodesPeer::ID, $podcastEpisodes->getDbId(), Criteria::NOT_EQUAL);
} }
return $this; return $this;

View file

@ -390,9 +390,9 @@ abstract class BasePodcastPeer
*/ */
public static function clearRelatedInstancePool() public static function clearRelatedInstancePool()
{ {
// Invalidate objects in PodcastContentsPeer instance pool, // Invalidate objects in PodcastEpisodesPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
PodcastContentsPeer::clearInstancePool(); PodcastEpisodesPeer::clearInstancePool();
} }
/** /**

View file

@ -32,9 +32,9 @@
* @method PodcastQuery rightJoinCcSubjs($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcSubjs relation * @method PodcastQuery rightJoinCcSubjs($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcSubjs relation
* @method PodcastQuery innerJoinCcSubjs($relationAlias = null) Adds a INNER JOIN clause to the query using the CcSubjs relation * @method PodcastQuery innerJoinCcSubjs($relationAlias = null) Adds a INNER JOIN clause to the query using the CcSubjs relation
* *
* @method PodcastQuery leftJoinPodcastContents($relationAlias = null) Adds a LEFT JOIN clause to the query using the PodcastContents relation * @method PodcastQuery leftJoinPodcastEpisodes($relationAlias = null) Adds a LEFT JOIN clause to the query using the PodcastEpisodes relation
* @method PodcastQuery rightJoinPodcastContents($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PodcastContents relation * @method PodcastQuery rightJoinPodcastEpisodes($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PodcastEpisodes relation
* @method PodcastQuery innerJoinPodcastContents($relationAlias = null) Adds a INNER JOIN clause to the query using the PodcastContents relation * @method PodcastQuery innerJoinPodcastEpisodes($relationAlias = null) Adds a INNER JOIN clause to the query using the PodcastEpisodes relation
* *
* @method Podcast findOne(PropelPDO $con = null) Return the first Podcast matching the query * @method Podcast findOne(PropelPDO $con = null) Return the first Podcast matching the query
* @method Podcast findOneOrCreate(PropelPDO $con = null) Return the first Podcast matching the query, or a new Podcast object populated from the query conditions when no match is found * @method Podcast findOneOrCreate(PropelPDO $con = null) Return the first Podcast matching the query, or a new Podcast object populated from the query conditions when no match is found
@ -599,41 +599,41 @@ abstract class BasePodcastQuery extends ModelCriteria
} }
/** /**
* Filter the query by a related PodcastContents object * Filter the query by a related PodcastEpisodes object
* *
* @param PodcastContents|PropelObjectCollection $podcastContents the related object to use as filter * @param PodcastEpisodes|PropelObjectCollection $podcastEpisodes the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return PodcastQuery The current query, for fluid interface * @return PodcastQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid. * @throws PropelException - if the provided filter is invalid.
*/ */
public function filterByPodcastContents($podcastContents, $comparison = null) public function filterByPodcastEpisodes($podcastEpisodes, $comparison = null)
{ {
if ($podcastContents instanceof PodcastContents) { if ($podcastEpisodes instanceof PodcastEpisodes) {
return $this return $this
->addUsingAlias(PodcastPeer::ID, $podcastContents->getDbPodcastId(), $comparison); ->addUsingAlias(PodcastPeer::ID, $podcastEpisodes->getDbPodcastId(), $comparison);
} elseif ($podcastContents instanceof PropelObjectCollection) { } elseif ($podcastEpisodes instanceof PropelObjectCollection) {
return $this return $this
->usePodcastContentsQuery() ->usePodcastEpisodesQuery()
->filterByPrimaryKeys($podcastContents->getPrimaryKeys()) ->filterByPrimaryKeys($podcastEpisodes->getPrimaryKeys())
->endUse(); ->endUse();
} else { } else {
throw new PropelException('filterByPodcastContents() only accepts arguments of type PodcastContents or PropelCollection'); throw new PropelException('filterByPodcastEpisodes() only accepts arguments of type PodcastEpisodes or PropelCollection');
} }
} }
/** /**
* Adds a JOIN clause to the query using the PodcastContents relation * Adds a JOIN clause to the query using the PodcastEpisodes relation
* *
* @param string $relationAlias optional alias for the relation * @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
* *
* @return PodcastQuery The current query, for fluid interface * @return PodcastQuery The current query, for fluid interface
*/ */
public function joinPodcastContents($relationAlias = null, $joinType = Criteria::INNER_JOIN) public function joinPodcastEpisodes($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{ {
$tableMap = $this->getTableMap(); $tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('PodcastContents'); $relationMap = $tableMap->getRelation('PodcastEpisodes');
// create a ModelJoin object for this join // create a ModelJoin object for this join
$join = new ModelJoin(); $join = new ModelJoin();
@ -648,14 +648,14 @@ abstract class BasePodcastQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias); $this->addJoinObject($join, $relationAlias);
} else { } else {
$this->addJoinObject($join, 'PodcastContents'); $this->addJoinObject($join, 'PodcastEpisodes');
} }
return $this; return $this;
} }
/** /**
* Use the PodcastContents relation PodcastContents object * Use the PodcastEpisodes relation PodcastEpisodes object
* *
* @see useQuery() * @see useQuery()
* *
@ -663,13 +663,13 @@ abstract class BasePodcastQuery extends ModelCriteria
* to be used as main alias in the secondary query * to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
* *
* @return PodcastContentsQuery A secondary query class using the current class as primary query * @return PodcastEpisodesQuery A secondary query class using the current class as primary query
*/ */
public function usePodcastContentsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) public function usePodcastEpisodesQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{ {
return $this return $this
->joinPodcastContents($relationAlias, $joinType) ->joinPodcastEpisodes($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'PodcastContents', 'PodcastContentsQuery'); ->useQuery($relationAlias ? $relationAlias : 'PodcastEpisodes', 'PodcastEpisodesQuery');
} }
/** /**

View file

@ -577,15 +577,17 @@
</foreign-key> </foreign-key>
</table> </table>
<table name="podcast_contents" phpName="PodcastContents"> <table name="podcast_episodes" phpName="PodcastEpisodes">
<column name="id" phpName="DbId" primaryKey="true" type="INTEGER" autoIncrement="true" required="true" /> <column name="id" phpName="DbId" primaryKey="true" type="INTEGER" autoIncrement="true" required="true" />
<column name="file_id" phpName="DbFileId" type="INTEGER" required="true" /> <column name="file_id" phpName="DbFileId" type="INTEGER" required="true" />
<column name="podcast_id" phpName="DbPodcastId" type="INTEGER" required="true" /> <column name="podcast_id" phpName="DbPodcastId" type="INTEGER" required="true" />
<column name="publication_date" phpName="DbPublicationDate" type="TIMESTAMP" required="true" /> <column name="publication_date" phpName="DbPublicationDate" type="TIMESTAMP" required="true" />
<foreign-key foreignTable="cc_files" name="podcast_contents_cc_files_fkey" onDelete="CASCADE"> <column name="download_url" phpName="DbDownloadUrl" type="varchar" size="512" required="true" />
<column name="episode_guid" phpName="DbEpisodeGuid" type="varchar" size="512" required="true" />
<foreign-key foreignTable="cc_files" name="podcast_episodes_cc_files_fkey" onDelete="CASCADE">
<reference local="file_id" foreign="id" /> <reference local="file_id" foreign="id" />
</foreign-key> </foreign-key>
<foreign-key foreignTable="podcast" name="podcast_contents_podcast_id_fkey" onDelete="CASCADE"> <foreign-key foreignTable="podcast" name="podcast_episodes_podcast_id_fkey" onDelete="CASCADE">
<reference local="podcast_id" foreign="id" /> <reference local="podcast_id" foreign="id" />
</foreign-key> </foreign-key>
</table> </table>

View file

@ -727,17 +727,19 @@ CREATE TABLE "podcast"
); );
----------------------------------------------------------------------- -----------------------------------------------------------------------
-- podcast_contents -- podcast_episodes
----------------------------------------------------------------------- -----------------------------------------------------------------------
DROP TABLE IF EXISTS "podcast_contents" CASCADE; DROP TABLE IF EXISTS "podcast_episodes" CASCADE;
CREATE TABLE "podcast_contents" CREATE TABLE "podcast_episodes"
( (
"id" serial NOT NULL, "id" serial NOT NULL,
"file_id" INTEGER NOT NULL, "file_id" INTEGER NOT NULL,
"podcast_id" INTEGER NOT NULL, "podcast_id" INTEGER NOT NULL,
"publication_date" TIMESTAMP NOT NULL, "publication_date" TIMESTAMP NOT NULL,
"download_url" VARCHAR(512) NOT NULL,
"episode_guid" VARCHAR(512) NOT NULL,
PRIMARY KEY ("id") PRIMARY KEY ("id")
); );
@ -918,12 +920,12 @@ ALTER TABLE "podcast" ADD CONSTRAINT "podcast_owner_fkey"
REFERENCES "cc_subjs" ("id") REFERENCES "cc_subjs" ("id")
ON DELETE CASCADE; ON DELETE CASCADE;
ALTER TABLE "podcast_contents" ADD CONSTRAINT "podcast_contents_cc_files_fkey" ALTER TABLE "podcast_episodes" ADD CONSTRAINT "podcast_episodes_cc_files_fkey"
FOREIGN KEY ("file_id") FOREIGN KEY ("file_id")
REFERENCES "cc_files" ("id") REFERENCES "cc_files" ("id")
ON DELETE CASCADE; ON DELETE CASCADE;
ALTER TABLE "podcast_contents" ADD CONSTRAINT "podcast_contents_podcast_id_fkey" ALTER TABLE "podcast_episodes" ADD CONSTRAINT "podcast_episodes_podcast_id_fkey"
FOREIGN KEY ("podcast_id") FOREIGN KEY ("podcast_id")
REFERENCES "podcast" ("id") REFERENCES "podcast" ("id")
ON DELETE CASCADE; ON DELETE CASCADE;