Bunch of schema changes

This commit is contained in:
drigato 2015-10-13 10:14:23 -04:00
parent c7dd2e7256
commit cfb21f8425
28 changed files with 1647 additions and 5494 deletions

View file

@ -15,237 +15,19 @@
*/
class ImportedPodcast extends BaseImportedPodcast
{
// These fields should never be modified with POST/PUT data
private static $privateFields = array(
"id",
"url",
"type",
"owner"
);
/** Creates a Podcast object from the given podcast URL.
* This is used by our Podcast REST API
*
* @param $data An array containing the URL for a Podcast object.
*
* @return array - Podcast Array with a full list of episodes
* @throws Exception
* @throws InvalidPodcastException
* @throws PodcastLimitReachedException
*/
public static function create($data)
/*public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (Application_Service_PodcastService::podcastLimitReached()) {
throw new PodcastLimitReachedException();
}
$rss = Application_Service_PodcastService::getPodcastFeed($data["url"]);
if (!$rss) {
throw new InvalidPodcastException();
}
// Ensure we are only creating Podcast with the given URL, and excluding
// any extra data fields that may have been POSTED
$podcastArray = array();
$podcastArray["url"] = $data["url"];
$podcastArray["title"] = $rss->get_title();
$podcastArray["description"] = $rss->get_description();
$podcastArray["link"] = $rss->get_link();
$podcastArray["language"] = $rss->get_language();
$podcastArray["copyright"] = $rss->get_copyright();
$podcastArray["creator"] = $rss->get_author()->get_name();
$podcastArray["category"] = $rss->get_categories();
$itunesChannel = "http://www.itunes.com/dtds/podcast-1.0.dtd";
$itunesSubtitle = $rss->get_channel_tags($itunesChannel, 'subtitle');
$podcastArray["itunes_subtitle"] = isset($itunesSubtitle[0]["data"]) ? $itunesSubtitle[0]["data"] : "";
$itunesCategory = $rss->get_channel_tags($itunesChannel, 'category');
$categoryArray = array();
foreach ($itunesCategory as $c => $data) {
foreach ($data["attribs"] as $attrib) {
array_push($categoryArray, $attrib["text"]);
}
}
$podcastArray["itunes_category"] = implode(",", $categoryArray);
$itunesAuthor = $rss->get_channel_tags($itunesChannel, 'author');
$podcastArray["itunes_author"] = isset($itunesAuthor[0]["data"]) ? $itunesAuthor[0]["data"] : "";
$itunesSummary = $rss->get_channel_tags($itunesChannel, 'summary');
$podcastArray["itunes_summary"] = isset($itunesSummary[0]["data"]) ? $itunesSummary[0]["data"] : "";
$itunesKeywords = $rss->get_channel_tags($itunesChannel, 'keywords');
$podcastArray["itunes_keywords"] = isset($itunesKeywords[0]["data"]) ? $itunesKeywords[0]["data"] : "";
$itunesExplicit = $rss->get_channel_tags($itunesChannel, 'explicit');
$podcastArray["itunes_explicit"] = isset($itunesExplicit[0]["data"]) ? $itunesExplicit[0]["data"] : "";
self::validatePodcastMetadata($podcastArray);
try {
$podcast = new Podcast();
$podcast->fromArray($podcastArray, BasePeer::TYPE_FIELDNAME);
$podcast->setDbOwner(self::getOwnerId());
$podcast->setDbType(IMPORTED_PODCAST);
$podcast->save();
return self::_generatePodcastArray($podcast, $rss);
} catch(Exception $e) {
$podcast->delete();
throw $e;
}
}
/**
* Fetches a Podcast's rss feed and returns all its episodes with
* the Podcast object
*
* @param $podcastId
*
* @throws PodcastNotFoundException
* @throws InvalidPodcastException
* @return array - Podcast Array with a full list of episodes
*/
public static function getPodcastById($podcastId)
{
$podcast = PodcastQuery::create()->findPk($podcastId);
if (!$podcast) {
throw new PodcastNotFoundException();
}
$rss = Application_Service_PodcastService::getPodcastFeed($podcast->getDbUrl());
if (!$rss) {
throw new InvalidPodcastException();
}
return self::_generatePodcastArray($podcast, $rss);
}
/**
* Given a podcast object and a SimplePie feed object,
* generate a data array to pass back to the front-end
*
* @param Podcast $podcast Podcast model object
* @param SimplePie $rss SimplePie feed object
*
* @return array
*/
private static function _generatePodcastArray($podcast, $rss) {
$podcastArray = $podcast->toArray(BasePeer::TYPE_FIELDNAME);
$podcastArray["episodes"] = array();
foreach ($rss->get_items() as $item) {
/** @var SimplePie_Item $item */
array_push($podcastArray["episodes"], array(
"guid" => $item->get_id(),
"title" => $item->get_title(),
"author" => $item->get_author()->get_name(),
"description" => $item->get_description(),
"pub_date" => $item->get_date("Y-m-d H:i:s"),
"link" => $item->get_link(),
"enclosure" => $item->get_enclosure()
));
}
return $podcastArray;
}
/**
* Updates a Podcast object with the given metadata
*
* @param $podcastId
* @param $data
* @return array
* @throws Exception
* @throws PodcastNotFoundException
*/
public static function updateFromArray($podcastId, $data)
{
$podcast = PodcastQuery::create()->findPk($podcastId);
if (!$podcast) {
throw new PodcastNotFoundException();
}
self::removePrivateFields($data);
self::validatePodcastMetadata($data);
$podcast->fromArray($data, BasePeer::TYPE_FIELDNAME);
$podcast->save();
return $podcast->toArray(BasePeer::TYPE_FIELDNAME);
}
/**
* Deletes a Podcast and its podcast episodes
*
* @param $podcastId
* @throws Exception
* @throws PodcastNotFoundException
*/
public static function deleteById($podcastId)
{
$podcast = PodcastQuery::create()->findPk($podcastId);
if ($podcast) {
$podcast->delete();
} else {
throw new PodcastNotFoundException();
}
}
/**
* Trims the podcast metadata to fit the table's column max size
*
* @param $podcastArray
*/
private static function validatePodcastMetadata(&$podcastArray)
{
$podcastTable = PodcastPeer::getTableMap();
foreach ($podcastArray as $key => &$value) {
try {
// Make sure column exists in table
$columnMaxSize = $podcastTable->getColumn($key)->getSize();
} catch (PropelException $e) {
continue;
}
if (strlen($value) > $columnMaxSize) {
$value = substr($value, 0, $podcastTable->getColumn($key)->getSize());
}
}
}
private static function removePrivateFields(&$data)
{
foreach (self::$privateFields as $key) {
unset($data[$key]);
}
}
//TODO move this somewhere where it makes sense
private static function getOwnerId()
{
try {
if (Zend_Auth::getInstance()->hasIdentity()) {
$service_user = new Application_Service_UserService();
return $service_user->getCurrentUser()->getDbId();
} else {
$defaultOwner = CcSubjsQuery::create()
->filterByDbType('A')
->orderByDbId()
->findOne();
if (!$defaultOwner) {
// what to do if there is no admin user?
// should we handle this case?
return null;
}
return $defaultOwner->getDbId();
}
} catch(Exception $e) {
Logging::info($e->getMessage());
}
}
$importedPodcastArray = parent::toArray(BasePeer::TYPE_FIELDNAME);
//unset this ID so we only pass back the Podcast ID
unset($importedPodcastArray["id"]);
$podcastArray = $this->getPodcast()->toArray(BasePeer::TYPE_FIELDNAME);
$array = array_merge($podcastArray, $importedPodcastArray);
//unset podcast_id because we already have that value in $importedPodcastArray
unset($array["podcast_id"]);
return $array;
}*/
}

View file

@ -0,0 +1,251 @@
<?php
/**
* Skeleton subclass for representing a row from the 'imported_podcast' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.airtime
*/
class ImportedPodcast extends BaseImportedPodcast
{
// These fields should never be modified with POST/PUT data
private static $privateFields = array(
"id",
"url",
"type",
"owner"
);
/** Creates a Podcast object from the given podcast URL.
* This is used by our Podcast REST API
*
* @param $data An array containing the URL for a Podcast object.
*
* @return array - Podcast Array with a full list of episodes
* @throws Exception
* @throws InvalidPodcastException
* @throws PodcastLimitReachedException
*/
public static function create($data)
{
if (Application_Service_PodcastService::podcastLimitReached()) {
throw new PodcastLimitReachedException();
}
$rss = Application_Service_PodcastService::getPodcastFeed($data["url"]);
if (!$rss) {
throw new InvalidPodcastException();
}
// Ensure we are only creating Podcast with the given URL, and excluding
// any extra data fields that may have been POSTED
$podcastArray = array();
$podcastArray["url"] = $data["url"];
$podcastArray["title"] = $rss->get_title();
$podcastArray["description"] = $rss->get_description();
$podcastArray["link"] = $rss->get_link();
$podcastArray["language"] = $rss->get_language();
$podcastArray["copyright"] = $rss->get_copyright();
$podcastArray["creator"] = $rss->get_author()->get_name();
$podcastArray["category"] = $rss->get_categories();
$itunesChannel = "http://www.itunes.com/dtds/podcast-1.0.dtd";
$itunesSubtitle = $rss->get_channel_tags($itunesChannel, 'subtitle');
$podcastArray["itunes_subtitle"] = isset($itunesSubtitle[0]["data"]) ? $itunesSubtitle[0]["data"] : "";
$itunesCategory = $rss->get_channel_tags($itunesChannel, 'category');
$categoryArray = array();
foreach ($itunesCategory as $c => $data) {
foreach ($data["attribs"] as $attrib) {
array_push($categoryArray, $attrib["text"]);
}
}
$podcastArray["itunes_category"] = implode(",", $categoryArray);
$itunesAuthor = $rss->get_channel_tags($itunesChannel, 'author');
$podcastArray["itunes_author"] = isset($itunesAuthor[0]["data"]) ? $itunesAuthor[0]["data"] : "";
$itunesSummary = $rss->get_channel_tags($itunesChannel, 'summary');
$podcastArray["itunes_summary"] = isset($itunesSummary[0]["data"]) ? $itunesSummary[0]["data"] : "";
$itunesKeywords = $rss->get_channel_tags($itunesChannel, 'keywords');
$podcastArray["itunes_keywords"] = isset($itunesKeywords[0]["data"]) ? $itunesKeywords[0]["data"] : "";
$itunesExplicit = $rss->get_channel_tags($itunesChannel, 'explicit');
$podcastArray["itunes_explicit"] = isset($itunesExplicit[0]["data"]) ? $itunesExplicit[0]["data"] : "";
self::validatePodcastMetadata($podcastArray);
try {
$podcast = new ImportedPodcast();
$podcast->fromArray($podcastArray, BasePeer::TYPE_FIELDNAME);
$podcast->setDbOwner(self::getOwnerId());
$podcast->setDbType(IMPORTED_PODCAST);
$podcast->save();
return self::_generatePodcastArray($podcast, $rss);
} catch(Exception $e) {
$podcast->delete();
throw $e;
}
}
/**
* Fetches a Podcast's rss feed and returns all its episodes with
* the Podcast object
*
* @param $podcastId
*
* @throws PodcastNotFoundException
* @throws InvalidPodcastException
* @return array - Podcast Array with a full list of episodes
*/
public static function getPodcastById($podcastId)
{
$podcast = PodcastQuery::create()->findPk($podcastId);
if (!$podcast) {
throw new PodcastNotFoundException();
}
$rss = Application_Service_PodcastService::getPodcastFeed($podcast->getDbUrl());
if (!$rss) {
throw new InvalidPodcastException();
}
return self::_generatePodcastArray($podcast, $rss);
}
/**
* Given a podcast object and a SimplePie feed object,
* generate a data array to pass back to the front-end
*
* @param Podcast $podcast Podcast model object
* @param SimplePie $rss SimplePie feed object
*
* @return array
*/
private static function _generatePodcastArray($podcast, $rss) {
$podcastArray = $podcast->toArray(BasePeer::TYPE_FIELDNAME);
$podcastArray["episodes"] = array();
foreach ($rss->get_items() as $item) {
/** @var SimplePie_Item $item */
array_push($podcastArray["episodes"], array(
"guid" => $item->get_id(),
"title" => $item->get_title(),
"author" => $item->get_author()->get_name(),
"description" => $item->get_description(),
"pub_date" => $item->get_date("Y-m-d H:i:s"),
"link" => $item->get_link(),
"enclosure" => $item->get_enclosure()
));
}
return $podcastArray;
}
/**
* Updates a Podcast object with the given metadata
*
* @param $podcastId
* @param $data
* @return array
* @throws Exception
* @throws PodcastNotFoundException
*/
public static function updateFromArray($podcastId, $data)
{
$podcast = PodcastQuery::create()->findPk($podcastId);
if (!$podcast) {
throw new PodcastNotFoundException();
}
self::removePrivateFields($data);
self::validatePodcastMetadata($data);
$podcast->fromArray($data, BasePeer::TYPE_FIELDNAME);
$podcast->save();
return $podcast->toArray(BasePeer::TYPE_FIELDNAME);
}
/**
* Deletes a Podcast and its podcast episodes
*
* @param $podcastId
* @throws Exception
* @throws PodcastNotFoundException
*/
public static function deleteById($podcastId)
{
$podcast = PodcastQuery::create()->findPk($podcastId);
if ($podcast) {
$podcast->delete();
} else {
throw new PodcastNotFoundException();
}
}
/**
* Trims the podcast metadata to fit the table's column max size
*
* @param $podcastArray
*/
private static function validatePodcastMetadata(&$podcastArray)
{
$podcastTable = PodcastPeer::getTableMap();
foreach ($podcastArray as $key => &$value) {
try {
// Make sure column exists in table
$columnMaxSize = $podcastTable->getColumn($key)->getSize();
} catch (PropelException $e) {
continue;
}
if (strlen($value) > $columnMaxSize) {
$value = substr($value, 0, $podcastTable->getColumn($key)->getSize());
}
}
}
private static function removePrivateFields(&$data)
{
foreach (self::$privateFields as $key) {
unset($data[$key]);
}
}
//TODO move this somewhere where it makes sense
private static function getOwnerId()
{
try {
if (Zend_Auth::getInstance()->hasIdentity()) {
$service_user = new Application_Service_UserService();
return $service_user->getCurrentUser()->getDbId();
} else {
$defaultOwner = CcSubjsQuery::create()
->filterByDbType('A')
->orderByDbId()
->findOne();
if (!$defaultOwner) {
// what to do if there is no admin user?
// should we handle this case?
return null;
}
return $defaultOwner->getDbId();
}
} catch(Exception $e) {
Logging::info($e->getMessage());
}
}
}

View file

@ -13,6 +13,24 @@
*
* @package propel.generator.airtime
*/
abstract class Podcast extends BasePodcast
class Podcast extends BasePodcast
{
/*public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
$podcastArray = parent::toArray(BasePeer::TYPE_FIELDNAME);
$podcastArray["url"] = $this->getDbUrl();
//$array = array_merge($podcastArray, $importedPodcastArray);
//unset podcast_id because we already have that value in $importedPodcastArray
//unset($array["podcast_id"]);
return $podcastArray;
}
public function getDbUrl()
{
return $this->getImportedPodcasts()->getFirst()->getDbUrl();
}*/
}

View file

@ -1,8 +1,6 @@
<?php
class PodcastEpisodeNotFoundException extends Exception
{
}
/**
* Skeleton subclass for representing a row from the 'podcast_episodes' table.
@ -17,103 +15,4 @@ class PodcastEpisodeNotFoundException extends Exception
*/
class PodcastEpisodes extends BasePodcastEpisodes
{
private static $privateFields = array(
"id"
);
/**
* @param $episodeId
* @return array
* @throws PodcastEpisodeNotFoundException
*/
public static function getPodcastEpisodeById($episodeId)
{
$episode = PodcastEpisodesQuery::create()->findPk($episodeId);
if (!$episode) {
throw new PodcastEpisodeNotFoundException();
}
return $episode->toArray(BasePeer::TYPE_FIELDNAME);
}
public static function getPodcastEpisodes($podcastId)
{
$podcast = PodcastQuery::create()->findPk($podcastId);
if (!$podcast) {
throw new PodcastNotFoundException();
}
$episodes = PodcastEpisodesQuery::create()->findByDbPodcastId($podcastId);
$episodesArray = array();
foreach ($episodes as $episode) {
array_push($episodesArray, $episode->toArray(BasePeer::TYPE_FIELDNAME));
}
return $episodesArray;
}
public static function create($podcastId, $data)
{
self::removePrivateFields($data);
self::validateEpisodeData($data);
try {
$episode = new PodcastEpisodes();
$episode->setDbPodcastId($podcastId);
$episode->fromArray($data, BasePeer::TYPE_FIELDNAME);
$episode->save();
return $episode->toArray(BasePeer::TYPE_FIELDNAME);
} catch (Exception $e) {
$episode->delete();
throw $e;
}
}
public static function deleteById($episodeId)
{
$episode = PodcastEpisodesQuery::create()->findByDbId($episodeId);
if ($episode) {
$episode->delete();
} else {
throw new PodcastEpisodeNotFoundException();
}
}
private static function removePrivateFields(&$data)
{
foreach (self::$privateFields as $key) {
unset($data[$key]);
}
}
/**
* Trims the episode data to fit the table's column max size
*
* @param $episodeArray
*/
private static function validateEpisodeData(&$episodeArray)
{
$podcastEpisodeTable = PodcastEpisodesPeer::getTableMap();
foreach ($episodeArray as $key => &$value) {
try {
// Make sure column exists in table
$columnMaxSize = $podcastEpisodeTable->getColumn($key)->getSize();
if (is_null($columnMaxSize)) {
continue;
}
} catch (PropelException $e) {
continue;
}
if (strlen($value) > $columnMaxSize) {
$value = substr($value, 0, $podcastEpisodeTable->getColumn($key)->getSize());
}
}
}
}

View file

@ -70,8 +70,6 @@ class CcSubjsTableMap extends TableMap
$this->addRelation('CcSess', 'CcSess', RelationMap::ONE_TO_MANY, array('id' => 'userid', ), 'CASCADE', null, 'CcSesss');
$this->addRelation('CcSubjsToken', 'CcSubjsToken', RelationMap::ONE_TO_MANY, array('id' => 'user_id', ), 'CASCADE', null, 'CcSubjsTokens');
$this->addRelation('Podcast', 'Podcast', RelationMap::ONE_TO_MANY, array('id' => 'owner', ), 'CASCADE', null, 'Podcasts');
$this->addRelation('StationPodcast', 'StationPodcast', RelationMap::ONE_TO_MANY, array('id' => 'owner', ), 'CASCADE', null, 'StationPodcasts');
$this->addRelation('ImportedPodcast', 'ImportedPodcast', RelationMap::ONE_TO_MANY, array('id' => 'owner', ), 'CASCADE', null, 'ImportedPodcasts');
} // buildRelations()
} // CcSubjsTableMap

View file

@ -36,24 +36,13 @@ class ImportedPodcastTableMap extends TableMap
$this->setPhpName('ImportedPodcast');
$this->setClassname('ImportedPodcast');
$this->setPackage('airtime');
$this->setUseIdGenerator(false);
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('imported_podcast_id_seq');
// columns
$this->addPrimaryKey('id', 'DbId', 'INTEGER', true, null, null);
$this->addColumn('url', 'DbUrl', 'VARCHAR', true, 4096, null);
$this->addColumn('auto_ingest', 'DbAutoIngest', 'BOOLEAN', true, null, false);
$this->addForeignPrimaryKey('id', 'DbId', 'INTEGER' , 'podcast', 'id', true, null, null);
$this->addColumn('title', 'DbTitle', 'VARCHAR', true, 4096, null);
$this->addColumn('creator', 'DbCreator', 'VARCHAR', false, 4096, null);
$this->addColumn('description', 'DbDescription', 'VARCHAR', false, 4096, null);
$this->addColumn('language', 'DbLanguage', 'VARCHAR', false, 4096, null);
$this->addColumn('copyright', 'DbCopyright', 'VARCHAR', false, 4096, null);
$this->addColumn('link', 'DbLink', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_author', 'DbItunesAuthor', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_keywords', 'DbItunesKeywords', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_summary', 'DbItunesSummary', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_subtitle', 'DbItunesSubtitle', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_category', 'DbItunesCategory', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_explicit', 'DbItunesExplicit', 'VARCHAR', false, 4096, null);
$this->addForeignKey('owner', 'DbOwner', 'INTEGER', 'cc_subjs', 'id', false, null, null);
$this->addForeignKey('podcast_id', 'DbPodcastId', 'INTEGER', 'podcast', 'id', true, null, null);
// validators
} // initialize()
@ -62,8 +51,7 @@ class ImportedPodcastTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Podcast', 'Podcast', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('owner' => 'id', ), 'CASCADE', null);
$this->addRelation('Podcast', 'Podcast', RelationMap::MANY_TO_ONE, array('podcast_id' => 'id', ), 'CASCADE', null);
} // buildRelations()
/**
@ -75,12 +63,8 @@ class ImportedPodcastTableMap extends TableMap
public function getBehaviors()
{
return array(
'concrete_inheritance' => array (
'extends' => 'podcast',
'descendant_column' => 'descendant_class',
'copy_data_to_parent' => 'true',
'schema' => '',
'excluded_parent_behavior' => 'nested_set',
'delegate' => array (
'to' => 'podcast',
),
);
} // getBehaviors()

View file

@ -53,7 +53,6 @@ class PodcastTableMap extends TableMap
$this->addColumn('itunes_category', 'DbItunesCategory', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_explicit', 'DbItunesExplicit', 'VARCHAR', false, 4096, null);
$this->addForeignKey('owner', 'DbOwner', 'INTEGER', 'cc_subjs', 'id', false, null, null);
$this->addColumn('descendant_class', 'DescendantClass', 'VARCHAR', false, 100, null);
// validators
} // initialize()
@ -63,24 +62,9 @@ class PodcastTableMap extends TableMap
public function buildRelations()
{
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('owner' => 'id', ), 'CASCADE', null);
$this->addRelation('StationPodcast', 'StationPodcast', RelationMap::ONE_TO_MANY, array('id' => 'podcast_id', ), 'CASCADE', null, 'StationPodcasts');
$this->addRelation('ImportedPodcast', 'ImportedPodcast', RelationMap::ONE_TO_MANY, array('id' => 'podcast_id', ), 'CASCADE', null, 'ImportedPodcasts');
$this->addRelation('PodcastEpisodes', 'PodcastEpisodes', RelationMap::ONE_TO_MANY, array('id' => 'podcast_id', ), 'CASCADE', null, 'PodcastEpisodess');
$this->addRelation('StationPodcast', 'StationPodcast', RelationMap::ONE_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
$this->addRelation('ImportedPodcast', 'ImportedPodcast', RelationMap::ONE_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
} // buildRelations()
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function getBehaviors()
{
return array(
'concrete_inheritance_parent' => array (
'descendant_column' => 'descendant_class',
),
);
} // getBehaviors()
} // PodcastTableMap

View file

@ -36,22 +36,11 @@ class StationPodcastTableMap extends TableMap
$this->setPhpName('StationPodcast');
$this->setClassname('StationPodcast');
$this->setPackage('airtime');
$this->setUseIdGenerator(false);
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('station_podcast_id_seq');
// columns
$this->addForeignPrimaryKey('id', 'DbId', 'INTEGER' , 'podcast', 'id', true, null, null);
$this->addColumn('title', 'DbTitle', 'VARCHAR', true, 4096, null);
$this->addColumn('creator', 'DbCreator', 'VARCHAR', false, 4096, null);
$this->addColumn('description', 'DbDescription', 'VARCHAR', false, 4096, null);
$this->addColumn('language', 'DbLanguage', 'VARCHAR', false, 4096, null);
$this->addColumn('copyright', 'DbCopyright', 'VARCHAR', false, 4096, null);
$this->addColumn('link', 'DbLink', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_author', 'DbItunesAuthor', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_keywords', 'DbItunesKeywords', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_summary', 'DbItunesSummary', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_subtitle', 'DbItunesSubtitle', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_category', 'DbItunesCategory', 'VARCHAR', false, 4096, null);
$this->addColumn('itunes_explicit', 'DbItunesExplicit', 'VARCHAR', false, 4096, null);
$this->addForeignKey('owner', 'DbOwner', 'INTEGER', 'cc_subjs', 'id', false, null, null);
$this->addPrimaryKey('id', 'DbId', 'INTEGER', true, null, null);
$this->addForeignKey('podcast_id', 'DbPodcastId', 'INTEGER', 'podcast', 'id', true, null, null);
// validators
} // initialize()
@ -60,8 +49,7 @@ class StationPodcastTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Podcast', 'Podcast', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('owner' => 'id', ), 'CASCADE', null);
$this->addRelation('Podcast', 'Podcast', RelationMap::MANY_TO_ONE, array('podcast_id' => 'id', ), 'CASCADE', null);
} // buildRelations()
/**
@ -73,12 +61,8 @@ class StationPodcastTableMap extends TableMap
public function getBehaviors()
{
return array(
'concrete_inheritance' => array (
'extends' => 'podcast',
'descendant_column' => 'descendant_class',
'copy_data_to_parent' => 'true',
'schema' => '',
'excluded_parent_behavior' => 'nested_set',
'delegate' => array (
'to' => 'podcast',
),
);
} // getBehaviors()

View file

@ -173,18 +173,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
protected $collPodcasts;
protected $collPodcastsPartial;
/**
* @var PropelObjectCollection|StationPodcast[] Collection to store aggregation of StationPodcast objects.
*/
protected $collStationPodcasts;
protected $collStationPodcastsPartial;
/**
* @var PropelObjectCollection|ImportedPodcast[] Collection to store aggregation of ImportedPodcast objects.
*/
protected $collImportedPodcasts;
protected $collImportedPodcastsPartial;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@ -265,18 +253,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
*/
protected $podcastsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var PropelObjectCollection
*/
protected $stationPodcastsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var PropelObjectCollection
*/
protected $importedPodcastsScheduledForDeletion = null;
/**
* Applies default values to this object.
* This method should be called from the object's constructor (or
@ -931,10 +907,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$this->collPodcasts = null;
$this->collStationPodcasts = null;
$this->collImportedPodcasts = null;
} // if (deep)
}
@ -1231,40 +1203,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
}
if ($this->stationPodcastsScheduledForDeletion !== null) {
if (!$this->stationPodcastsScheduledForDeletion->isEmpty()) {
StationPodcastQuery::create()
->filterByPrimaryKeys($this->stationPodcastsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->stationPodcastsScheduledForDeletion = null;
}
}
if ($this->collStationPodcasts !== null) {
foreach ($this->collStationPodcasts as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->importedPodcastsScheduledForDeletion !== null) {
if (!$this->importedPodcastsScheduledForDeletion->isEmpty()) {
ImportedPodcastQuery::create()
->filterByPrimaryKeys($this->importedPodcastsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->importedPodcastsScheduledForDeletion = null;
}
}
if ($this->collImportedPodcasts !== null) {
foreach ($this->collImportedPodcasts as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
@ -1562,22 +1500,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
}
if ($this->collStationPodcasts !== null) {
foreach ($this->collStationPodcasts as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
if ($this->collImportedPodcasts !== null) {
foreach ($this->collImportedPodcasts as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
@ -1731,12 +1653,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
if (null !== $this->collPodcasts) {
$result['Podcasts'] = $this->collPodcasts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collStationPodcasts) {
$result['StationPodcasts'] = $this->collStationPodcasts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collImportedPodcasts) {
$result['ImportedPodcasts'] = $this->collImportedPodcasts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
}
return $result;
@ -2014,18 +1930,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
}
foreach ($this->getStationPodcasts() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addStationPodcast($relObj->copy($deepCopy));
}
}
foreach ($this->getImportedPodcasts() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addImportedPodcast($relObj->copy($deepCopy));
}
}
//unflag object copy
$this->startCopy = false;
} // if ($deepCopy)
@ -2117,12 +2021,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
if ('Podcast' == $relationName) {
$this->initPodcasts();
}
if ('StationPodcast' == $relationName) {
$this->initStationPodcasts();
}
if ('ImportedPodcast' == $relationName) {
$this->initImportedPodcasts();
}
}
/**
@ -4450,506 +4348,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
return $this;
}
/**
* Clears out the collStationPodcasts collection
*
* This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method.
*
* @return CcSubjs The current object (for fluent API support)
* @see addStationPodcasts()
*/
public function clearStationPodcasts()
{
$this->collStationPodcasts = null; // important to set this to null since that means it is uninitialized
$this->collStationPodcastsPartial = null;
return $this;
}
/**
* reset is the collStationPodcasts collection loaded partially
*
* @return void
*/
public function resetPartialStationPodcasts($v = true)
{
$this->collStationPodcastsPartial = $v;
}
/**
* Initializes the collStationPodcasts collection.
*
* By default this just sets the collStationPodcasts collection to an empty array (like clearcollStationPodcasts());
* 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.
*
* @param boolean $overrideExisting If set to true, the method call initializes
* the collection even if it is not empty
*
* @return void
*/
public function initStationPodcasts($overrideExisting = true)
{
if (null !== $this->collStationPodcasts && !$overrideExisting) {
return;
}
$this->collStationPodcasts = new PropelObjectCollection();
$this->collStationPodcasts->setModel('StationPodcast');
}
/**
* Gets an array of StationPodcast objects which contain a foreign key that references this object.
*
* If the $criteria is not null, it is used to always fetch the results from the database.
* Otherwise the results are fetched from the database the first time, then cached.
* Next time the same method is called without $criteria, the cached collection is returned.
* If this CcSubjs is new, it will return
* an empty collection or the current collection; the criteria is ignored on a new object.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
* @return PropelObjectCollection|StationPodcast[] List of StationPodcast objects
* @throws PropelException
*/
public function getStationPodcasts($criteria = null, PropelPDO $con = null)
{
$partial = $this->collStationPodcastsPartial && !$this->isNew();
if (null === $this->collStationPodcasts || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collStationPodcasts) {
// return empty collection
$this->initStationPodcasts();
} else {
$collStationPodcasts = StationPodcastQuery::create(null, $criteria)
->filterByCcSubjs($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collStationPodcastsPartial && count($collStationPodcasts)) {
$this->initStationPodcasts(false);
foreach ($collStationPodcasts as $obj) {
if (false == $this->collStationPodcasts->contains($obj)) {
$this->collStationPodcasts->append($obj);
}
}
$this->collStationPodcastsPartial = true;
}
$collStationPodcasts->getInternalIterator()->rewind();
return $collStationPodcasts;
}
if ($partial && $this->collStationPodcasts) {
foreach ($this->collStationPodcasts as $obj) {
if ($obj->isNew()) {
$collStationPodcasts[] = $obj;
}
}
}
$this->collStationPodcasts = $collStationPodcasts;
$this->collStationPodcastsPartial = false;
}
}
return $this->collStationPodcasts;
}
/**
* Sets a collection of StationPodcast objects related by a one-to-many relationship
* to the current object.
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
* and new objects from the given Propel collection.
*
* @param PropelCollection $stationPodcasts A Propel collection.
* @param PropelPDO $con Optional connection object
* @return CcSubjs The current object (for fluent API support)
*/
public function setStationPodcasts(PropelCollection $stationPodcasts, PropelPDO $con = null)
{
$stationPodcastsToDelete = $this->getStationPodcasts(new Criteria(), $con)->diff($stationPodcasts);
$this->stationPodcastsScheduledForDeletion = $stationPodcastsToDelete;
foreach ($stationPodcastsToDelete as $stationPodcastRemoved) {
$stationPodcastRemoved->setCcSubjs(null);
}
$this->collStationPodcasts = null;
foreach ($stationPodcasts as $stationPodcast) {
$this->addStationPodcast($stationPodcast);
}
$this->collStationPodcasts = $stationPodcasts;
$this->collStationPodcastsPartial = false;
return $this;
}
/**
* Returns the number of related StationPodcast objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param PropelPDO $con
* @return int Count of related StationPodcast objects.
* @throws PropelException
*/
public function countStationPodcasts(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
$partial = $this->collStationPodcastsPartial && !$this->isNew();
if (null === $this->collStationPodcasts || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collStationPodcasts) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getStationPodcasts());
}
$query = StationPodcastQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByCcSubjs($this)
->count($con);
}
return count($this->collStationPodcasts);
}
/**
* Method called to associate a StationPodcast object to this object
* through the StationPodcast foreign key attribute.
*
* @param StationPodcast $l StationPodcast
* @return CcSubjs The current object (for fluent API support)
*/
public function addStationPodcast(StationPodcast $l)
{
if ($this->collStationPodcasts === null) {
$this->initStationPodcasts();
$this->collStationPodcastsPartial = true;
}
if (!in_array($l, $this->collStationPodcasts->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddStationPodcast($l);
if ($this->stationPodcastsScheduledForDeletion and $this->stationPodcastsScheduledForDeletion->contains($l)) {
$this->stationPodcastsScheduledForDeletion->remove($this->stationPodcastsScheduledForDeletion->search($l));
}
}
return $this;
}
/**
* @param StationPodcast $stationPodcast The stationPodcast object to add.
*/
protected function doAddStationPodcast($stationPodcast)
{
$this->collStationPodcasts[]= $stationPodcast;
$stationPodcast->setCcSubjs($this);
}
/**
* @param StationPodcast $stationPodcast The stationPodcast object to remove.
* @return CcSubjs The current object (for fluent API support)
*/
public function removeStationPodcast($stationPodcast)
{
if ($this->getStationPodcasts()->contains($stationPodcast)) {
$this->collStationPodcasts->remove($this->collStationPodcasts->search($stationPodcast));
if (null === $this->stationPodcastsScheduledForDeletion) {
$this->stationPodcastsScheduledForDeletion = clone $this->collStationPodcasts;
$this->stationPodcastsScheduledForDeletion->clear();
}
$this->stationPodcastsScheduledForDeletion[]= $stationPodcast;
$stationPodcast->setCcSubjs(null);
}
return $this;
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this CcSubjs is new, it will return
* an empty collection; or if this CcSubjs has previously
* been saved, it will retrieve related StationPodcasts from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in CcSubjs.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
* @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return PropelObjectCollection|StationPodcast[] List of StationPodcast objects
*/
public function getStationPodcastsJoinPodcast($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$query = StationPodcastQuery::create(null, $criteria);
$query->joinWith('Podcast', $join_behavior);
return $this->getStationPodcasts($query, $con);
}
/**
* Clears out the collImportedPodcasts collection
*
* This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method.
*
* @return CcSubjs The current object (for fluent API support)
* @see addImportedPodcasts()
*/
public function clearImportedPodcasts()
{
$this->collImportedPodcasts = null; // important to set this to null since that means it is uninitialized
$this->collImportedPodcastsPartial = null;
return $this;
}
/**
* reset is the collImportedPodcasts collection loaded partially
*
* @return void
*/
public function resetPartialImportedPodcasts($v = true)
{
$this->collImportedPodcastsPartial = $v;
}
/**
* Initializes the collImportedPodcasts collection.
*
* By default this just sets the collImportedPodcasts collection to an empty array (like clearcollImportedPodcasts());
* 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.
*
* @param boolean $overrideExisting If set to true, the method call initializes
* the collection even if it is not empty
*
* @return void
*/
public function initImportedPodcasts($overrideExisting = true)
{
if (null !== $this->collImportedPodcasts && !$overrideExisting) {
return;
}
$this->collImportedPodcasts = new PropelObjectCollection();
$this->collImportedPodcasts->setModel('ImportedPodcast');
}
/**
* Gets an array of ImportedPodcast objects which contain a foreign key that references this object.
*
* If the $criteria is not null, it is used to always fetch the results from the database.
* Otherwise the results are fetched from the database the first time, then cached.
* Next time the same method is called without $criteria, the cached collection is returned.
* If this CcSubjs is new, it will return
* an empty collection or the current collection; the criteria is ignored on a new object.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
* @return PropelObjectCollection|ImportedPodcast[] List of ImportedPodcast objects
* @throws PropelException
*/
public function getImportedPodcasts($criteria = null, PropelPDO $con = null)
{
$partial = $this->collImportedPodcastsPartial && !$this->isNew();
if (null === $this->collImportedPodcasts || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collImportedPodcasts) {
// return empty collection
$this->initImportedPodcasts();
} else {
$collImportedPodcasts = ImportedPodcastQuery::create(null, $criteria)
->filterByCcSubjs($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collImportedPodcastsPartial && count($collImportedPodcasts)) {
$this->initImportedPodcasts(false);
foreach ($collImportedPodcasts as $obj) {
if (false == $this->collImportedPodcasts->contains($obj)) {
$this->collImportedPodcasts->append($obj);
}
}
$this->collImportedPodcastsPartial = true;
}
$collImportedPodcasts->getInternalIterator()->rewind();
return $collImportedPodcasts;
}
if ($partial && $this->collImportedPodcasts) {
foreach ($this->collImportedPodcasts as $obj) {
if ($obj->isNew()) {
$collImportedPodcasts[] = $obj;
}
}
}
$this->collImportedPodcasts = $collImportedPodcasts;
$this->collImportedPodcastsPartial = false;
}
}
return $this->collImportedPodcasts;
}
/**
* Sets a collection of ImportedPodcast objects related by a one-to-many relationship
* to the current object.
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
* and new objects from the given Propel collection.
*
* @param PropelCollection $importedPodcasts A Propel collection.
* @param PropelPDO $con Optional connection object
* @return CcSubjs The current object (for fluent API support)
*/
public function setImportedPodcasts(PropelCollection $importedPodcasts, PropelPDO $con = null)
{
$importedPodcastsToDelete = $this->getImportedPodcasts(new Criteria(), $con)->diff($importedPodcasts);
$this->importedPodcastsScheduledForDeletion = $importedPodcastsToDelete;
foreach ($importedPodcastsToDelete as $importedPodcastRemoved) {
$importedPodcastRemoved->setCcSubjs(null);
}
$this->collImportedPodcasts = null;
foreach ($importedPodcasts as $importedPodcast) {
$this->addImportedPodcast($importedPodcast);
}
$this->collImportedPodcasts = $importedPodcasts;
$this->collImportedPodcastsPartial = false;
return $this;
}
/**
* Returns the number of related ImportedPodcast objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param PropelPDO $con
* @return int Count of related ImportedPodcast objects.
* @throws PropelException
*/
public function countImportedPodcasts(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
$partial = $this->collImportedPodcastsPartial && !$this->isNew();
if (null === $this->collImportedPodcasts || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collImportedPodcasts) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getImportedPodcasts());
}
$query = ImportedPodcastQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByCcSubjs($this)
->count($con);
}
return count($this->collImportedPodcasts);
}
/**
* Method called to associate a ImportedPodcast object to this object
* through the ImportedPodcast foreign key attribute.
*
* @param ImportedPodcast $l ImportedPodcast
* @return CcSubjs The current object (for fluent API support)
*/
public function addImportedPodcast(ImportedPodcast $l)
{
if ($this->collImportedPodcasts === null) {
$this->initImportedPodcasts();
$this->collImportedPodcastsPartial = true;
}
if (!in_array($l, $this->collImportedPodcasts->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddImportedPodcast($l);
if ($this->importedPodcastsScheduledForDeletion and $this->importedPodcastsScheduledForDeletion->contains($l)) {
$this->importedPodcastsScheduledForDeletion->remove($this->importedPodcastsScheduledForDeletion->search($l));
}
}
return $this;
}
/**
* @param ImportedPodcast $importedPodcast The importedPodcast object to add.
*/
protected function doAddImportedPodcast($importedPodcast)
{
$this->collImportedPodcasts[]= $importedPodcast;
$importedPodcast->setCcSubjs($this);
}
/**
* @param ImportedPodcast $importedPodcast The importedPodcast object to remove.
* @return CcSubjs The current object (for fluent API support)
*/
public function removeImportedPodcast($importedPodcast)
{
if ($this->getImportedPodcasts()->contains($importedPodcast)) {
$this->collImportedPodcasts->remove($this->collImportedPodcasts->search($importedPodcast));
if (null === $this->importedPodcastsScheduledForDeletion) {
$this->importedPodcastsScheduledForDeletion = clone $this->collImportedPodcasts;
$this->importedPodcastsScheduledForDeletion->clear();
}
$this->importedPodcastsScheduledForDeletion[]= $importedPodcast;
$importedPodcast->setCcSubjs(null);
}
return $this;
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this CcSubjs is new, it will return
* an empty collection; or if this CcSubjs has previously
* been saved, it will retrieve related ImportedPodcasts from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in CcSubjs.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
* @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return PropelObjectCollection|ImportedPodcast[] List of ImportedPodcast objects
*/
public function getImportedPodcastsJoinPodcast($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$query = ImportedPodcastQuery::create(null, $criteria);
$query->joinWith('Podcast', $join_behavior);
return $this->getImportedPodcasts($query, $con);
}
/**
* Clears the current object and sets all attributes to their default values
*/
@ -5041,16 +4439,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$o->clearAllReferences($deep);
}
}
if ($this->collStationPodcasts) {
foreach ($this->collStationPodcasts as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collImportedPodcasts) {
foreach ($this->collImportedPodcasts as $o) {
$o->clearAllReferences($deep);
}
}
$this->alreadyInClearAllReferencesDeep = false;
} // if ($deep)
@ -5095,14 +4483,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$this->collPodcasts->clearIterator();
}
$this->collPodcasts = null;
if ($this->collStationPodcasts instanceof PropelCollection) {
$this->collStationPodcasts->clearIterator();
}
$this->collStationPodcasts = null;
if ($this->collImportedPodcasts instanceof PropelCollection) {
$this->collImportedPodcasts->clearIterator();
}
$this->collImportedPodcasts = null;
}
/**

View file

@ -439,12 +439,6 @@ abstract class BaseCcSubjsPeer
// Invalidate objects in PodcastPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
PodcastPeer::clearInstancePool();
// Invalidate objects in StationPodcastPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
StationPodcastPeer::clearInstancePool();
// Invalidate objects in ImportedPodcastPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
ImportedPodcastPeer::clearInstancePool();
}
/**

View file

@ -78,14 +78,6 @@
* @method CcSubjsQuery rightJoinPodcast($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Podcast relation
* @method CcSubjsQuery innerJoinPodcast($relationAlias = null) Adds a INNER JOIN clause to the query using the Podcast relation
*
* @method CcSubjsQuery leftJoinStationPodcast($relationAlias = null) Adds a LEFT JOIN clause to the query using the StationPodcast relation
* @method CcSubjsQuery rightJoinStationPodcast($relationAlias = null) Adds a RIGHT JOIN clause to the query using the StationPodcast relation
* @method CcSubjsQuery innerJoinStationPodcast($relationAlias = null) Adds a INNER JOIN clause to the query using the StationPodcast relation
*
* @method CcSubjsQuery leftJoinImportedPodcast($relationAlias = null) Adds a LEFT JOIN clause to the query using the ImportedPodcast relation
* @method CcSubjsQuery rightJoinImportedPodcast($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ImportedPodcast relation
* @method CcSubjsQuery innerJoinImportedPodcast($relationAlias = null) Adds a INNER JOIN clause to the query using the ImportedPodcast relation
*
* @method CcSubjs findOne(PropelPDO $con = null) Return the first CcSubjs matching the query
* @method CcSubjs findOneOrCreate(PropelPDO $con = null) Return the first CcSubjs matching the query, or a new CcSubjs object populated from the query conditions when no match is found
*
@ -1482,154 +1474,6 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'Podcast', 'PodcastQuery');
}
/**
* Filter the query by a related StationPodcast object
*
* @param StationPodcast|PropelObjectCollection $stationPodcast the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByStationPodcast($stationPodcast, $comparison = null)
{
if ($stationPodcast instanceof StationPodcast) {
return $this
->addUsingAlias(CcSubjsPeer::ID, $stationPodcast->getDbOwner(), $comparison);
} elseif ($stationPodcast instanceof PropelObjectCollection) {
return $this
->useStationPodcastQuery()
->filterByPrimaryKeys($stationPodcast->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByStationPodcast() only accepts arguments of type StationPodcast or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the StationPodcast relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function joinStationPodcast($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('StationPodcast');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'StationPodcast');
}
return $this;
}
/**
* Use the StationPodcast relation StationPodcast object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return StationPodcastQuery A secondary query class using the current class as primary query
*/
public function useStationPodcastQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinStationPodcast($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'StationPodcast', 'StationPodcastQuery');
}
/**
* Filter the query by a related ImportedPodcast object
*
* @param ImportedPodcast|PropelObjectCollection $importedPodcast the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByImportedPodcast($importedPodcast, $comparison = null)
{
if ($importedPodcast instanceof ImportedPodcast) {
return $this
->addUsingAlias(CcSubjsPeer::ID, $importedPodcast->getDbOwner(), $comparison);
} elseif ($importedPodcast instanceof PropelObjectCollection) {
return $this
->useImportedPodcastQuery()
->filterByPrimaryKeys($importedPodcast->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByImportedPodcast() only accepts arguments of type ImportedPodcast or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the ImportedPodcast relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function joinImportedPodcast($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ImportedPodcast');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'ImportedPodcast');
}
return $this;
}
/**
* Use the ImportedPodcast relation ImportedPodcast object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ImportedPodcastQuery A secondary query class using the current class as primary query
*/
public function useImportedPodcastQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinImportedPodcast($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ImportedPodcast', 'ImportedPodcastQuery');
}
/**
* Exclude object from result
*

View file

@ -8,7 +8,7 @@
*
* @package propel.generator.airtime.om
*/
abstract class BaseImportedPodcastPeer extends PodcastPeer
abstract class BaseImportedPodcastPeer
{
/** the default database name for this class */
@ -24,13 +24,16 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
const TM_CLASS = 'ImportedPodcastTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 16;
const NUM_COLUMNS = 4;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */
const NUM_HYDRATE_COLUMNS = 16;
const NUM_HYDRATE_COLUMNS = 4;
/** the column name for the id field */
const ID = 'imported_podcast.id';
/** the column name for the url field */
const URL = 'imported_podcast.url';
@ -38,47 +41,8 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
/** the column name for the auto_ingest field */
const AUTO_INGEST = 'imported_podcast.auto_ingest';
/** the column name for the id field */
const ID = 'imported_podcast.id';
/** the column name for the title field */
const TITLE = 'imported_podcast.title';
/** the column name for the creator field */
const CREATOR = 'imported_podcast.creator';
/** the column name for the description field */
const DESCRIPTION = 'imported_podcast.description';
/** the column name for the language field */
const LANGUAGE = 'imported_podcast.language';
/** the column name for the copyright field */
const COPYRIGHT = 'imported_podcast.copyright';
/** the column name for the link field */
const LINK = 'imported_podcast.link';
/** the column name for the itunes_author field */
const ITUNES_AUTHOR = 'imported_podcast.itunes_author';
/** the column name for the itunes_keywords field */
const ITUNES_KEYWORDS = 'imported_podcast.itunes_keywords';
/** the column name for the itunes_summary field */
const ITUNES_SUMMARY = 'imported_podcast.itunes_summary';
/** the column name for the itunes_subtitle field */
const ITUNES_SUBTITLE = 'imported_podcast.itunes_subtitle';
/** the column name for the itunes_category field */
const ITUNES_CATEGORY = 'imported_podcast.itunes_category';
/** the column name for the itunes_explicit field */
const ITUNES_EXPLICIT = 'imported_podcast.itunes_explicit';
/** the column name for the owner field */
const OWNER = 'imported_podcast.owner';
/** the column name for the podcast_id field */
const PODCAST_ID = 'imported_podcast.podcast_id';
/** The default string format for model objects of the related table **/
const DEFAULT_STRING_FORMAT = 'YAML';
@ -99,12 +63,12 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
* e.g. ImportedPodcastPeer::$fieldNames[ImportedPodcastPeer::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbUrl', 'DbAutoIngest', 'DbId', 'DbTitle', 'DbCreator', 'DbDescription', 'DbLanguage', 'DbCopyright', 'DbLink', 'DbItunesAuthor', 'DbItunesKeywords', 'DbItunesSummary', 'DbItunesSubtitle', 'DbItunesCategory', 'DbItunesExplicit', 'DbOwner', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbUrl', 'dbAutoIngest', 'dbId', 'dbTitle', 'dbCreator', 'dbDescription', 'dbLanguage', 'dbCopyright', 'dbLink', 'dbItunesAuthor', 'dbItunesKeywords', 'dbItunesSummary', 'dbItunesSubtitle', 'dbItunesCategory', 'dbItunesExplicit', 'dbOwner', ),
BasePeer::TYPE_COLNAME => array (ImportedPodcastPeer::URL, ImportedPodcastPeer::AUTO_INGEST, ImportedPodcastPeer::ID, ImportedPodcastPeer::TITLE, ImportedPodcastPeer::CREATOR, ImportedPodcastPeer::DESCRIPTION, ImportedPodcastPeer::LANGUAGE, ImportedPodcastPeer::COPYRIGHT, ImportedPodcastPeer::LINK, ImportedPodcastPeer::ITUNES_AUTHOR, ImportedPodcastPeer::ITUNES_KEYWORDS, ImportedPodcastPeer::ITUNES_SUMMARY, ImportedPodcastPeer::ITUNES_SUBTITLE, ImportedPodcastPeer::ITUNES_CATEGORY, ImportedPodcastPeer::ITUNES_EXPLICIT, ImportedPodcastPeer::OWNER, ),
BasePeer::TYPE_RAW_COLNAME => array ('URL', 'AUTO_INGEST', 'ID', 'TITLE', 'CREATOR', 'DESCRIPTION', 'LANGUAGE', 'COPYRIGHT', 'LINK', 'ITUNES_AUTHOR', 'ITUNES_KEYWORDS', 'ITUNES_SUMMARY', 'ITUNES_SUBTITLE', 'ITUNES_CATEGORY', 'ITUNES_EXPLICIT', 'OWNER', ),
BasePeer::TYPE_FIELDNAME => array ('url', 'auto_ingest', 'id', 'title', 'creator', 'description', 'language', 'copyright', 'link', 'itunes_author', 'itunes_keywords', 'itunes_summary', 'itunes_subtitle', 'itunes_category', 'itunes_explicit', 'owner', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbUrl', 'DbAutoIngest', 'DbPodcastId', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbUrl', 'dbAutoIngest', 'dbPodcastId', ),
BasePeer::TYPE_COLNAME => array (ImportedPodcastPeer::ID, ImportedPodcastPeer::URL, ImportedPodcastPeer::AUTO_INGEST, ImportedPodcastPeer::PODCAST_ID, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'URL', 'AUTO_INGEST', 'PODCAST_ID', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'url', 'auto_ingest', 'podcast_id', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
/**
@ -114,12 +78,12 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
* e.g. ImportedPodcastPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbUrl' => 0, 'DbAutoIngest' => 1, 'DbId' => 2, 'DbTitle' => 3, 'DbCreator' => 4, 'DbDescription' => 5, 'DbLanguage' => 6, 'DbCopyright' => 7, 'DbLink' => 8, 'DbItunesAuthor' => 9, 'DbItunesKeywords' => 10, 'DbItunesSummary' => 11, 'DbItunesSubtitle' => 12, 'DbItunesCategory' => 13, 'DbItunesExplicit' => 14, 'DbOwner' => 15, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbUrl' => 0, 'dbAutoIngest' => 1, 'dbId' => 2, 'dbTitle' => 3, 'dbCreator' => 4, 'dbDescription' => 5, 'dbLanguage' => 6, 'dbCopyright' => 7, 'dbLink' => 8, 'dbItunesAuthor' => 9, 'dbItunesKeywords' => 10, 'dbItunesSummary' => 11, 'dbItunesSubtitle' => 12, 'dbItunesCategory' => 13, 'dbItunesExplicit' => 14, 'dbOwner' => 15, ),
BasePeer::TYPE_COLNAME => array (ImportedPodcastPeer::URL => 0, ImportedPodcastPeer::AUTO_INGEST => 1, ImportedPodcastPeer::ID => 2, ImportedPodcastPeer::TITLE => 3, ImportedPodcastPeer::CREATOR => 4, ImportedPodcastPeer::DESCRIPTION => 5, ImportedPodcastPeer::LANGUAGE => 6, ImportedPodcastPeer::COPYRIGHT => 7, ImportedPodcastPeer::LINK => 8, ImportedPodcastPeer::ITUNES_AUTHOR => 9, ImportedPodcastPeer::ITUNES_KEYWORDS => 10, ImportedPodcastPeer::ITUNES_SUMMARY => 11, ImportedPodcastPeer::ITUNES_SUBTITLE => 12, ImportedPodcastPeer::ITUNES_CATEGORY => 13, ImportedPodcastPeer::ITUNES_EXPLICIT => 14, ImportedPodcastPeer::OWNER => 15, ),
BasePeer::TYPE_RAW_COLNAME => array ('URL' => 0, 'AUTO_INGEST' => 1, 'ID' => 2, 'TITLE' => 3, 'CREATOR' => 4, 'DESCRIPTION' => 5, 'LANGUAGE' => 6, 'COPYRIGHT' => 7, 'LINK' => 8, 'ITUNES_AUTHOR' => 9, 'ITUNES_KEYWORDS' => 10, 'ITUNES_SUMMARY' => 11, 'ITUNES_SUBTITLE' => 12, 'ITUNES_CATEGORY' => 13, 'ITUNES_EXPLICIT' => 14, 'OWNER' => 15, ),
BasePeer::TYPE_FIELDNAME => array ('url' => 0, 'auto_ingest' => 1, 'id' => 2, 'title' => 3, 'creator' => 4, 'description' => 5, 'language' => 6, 'copyright' => 7, 'link' => 8, 'itunes_author' => 9, 'itunes_keywords' => 10, 'itunes_summary' => 11, 'itunes_subtitle' => 12, 'itunes_category' => 13, 'itunes_explicit' => 14, 'owner' => 15, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbUrl' => 1, 'DbAutoIngest' => 2, 'DbPodcastId' => 3, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbUrl' => 1, 'dbAutoIngest' => 2, 'dbPodcastId' => 3, ),
BasePeer::TYPE_COLNAME => array (ImportedPodcastPeer::ID => 0, ImportedPodcastPeer::URL => 1, ImportedPodcastPeer::AUTO_INGEST => 2, ImportedPodcastPeer::PODCAST_ID => 3, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'URL' => 1, 'AUTO_INGEST' => 2, 'PODCAST_ID' => 3, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'url' => 1, 'auto_ingest' => 2, 'podcast_id' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
/**
@ -193,39 +157,15 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(ImportedPodcastPeer::ID);
$criteria->addSelectColumn(ImportedPodcastPeer::URL);
$criteria->addSelectColumn(ImportedPodcastPeer::AUTO_INGEST);
$criteria->addSelectColumn(ImportedPodcastPeer::ID);
$criteria->addSelectColumn(ImportedPodcastPeer::TITLE);
$criteria->addSelectColumn(ImportedPodcastPeer::CREATOR);
$criteria->addSelectColumn(ImportedPodcastPeer::DESCRIPTION);
$criteria->addSelectColumn(ImportedPodcastPeer::LANGUAGE);
$criteria->addSelectColumn(ImportedPodcastPeer::COPYRIGHT);
$criteria->addSelectColumn(ImportedPodcastPeer::LINK);
$criteria->addSelectColumn(ImportedPodcastPeer::ITUNES_AUTHOR);
$criteria->addSelectColumn(ImportedPodcastPeer::ITUNES_KEYWORDS);
$criteria->addSelectColumn(ImportedPodcastPeer::ITUNES_SUMMARY);
$criteria->addSelectColumn(ImportedPodcastPeer::ITUNES_SUBTITLE);
$criteria->addSelectColumn(ImportedPodcastPeer::ITUNES_CATEGORY);
$criteria->addSelectColumn(ImportedPodcastPeer::ITUNES_EXPLICIT);
$criteria->addSelectColumn(ImportedPodcastPeer::OWNER);
$criteria->addSelectColumn(ImportedPodcastPeer::PODCAST_ID);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.url');
$criteria->addSelectColumn($alias . '.auto_ingest');
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.title');
$criteria->addSelectColumn($alias . '.creator');
$criteria->addSelectColumn($alias . '.description');
$criteria->addSelectColumn($alias . '.language');
$criteria->addSelectColumn($alias . '.copyright');
$criteria->addSelectColumn($alias . '.link');
$criteria->addSelectColumn($alias . '.itunes_author');
$criteria->addSelectColumn($alias . '.itunes_keywords');
$criteria->addSelectColumn($alias . '.itunes_summary');
$criteria->addSelectColumn($alias . '.itunes_subtitle');
$criteria->addSelectColumn($alias . '.itunes_category');
$criteria->addSelectColumn($alias . '.itunes_explicit');
$criteria->addSelectColumn($alias . '.owner');
$criteria->addSelectColumn($alias . '.podcast_id');
}
}
@ -445,11 +385,11 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
{
// If the PK cannot be derived from the row, return null.
if ($row[$startcol + 2] === null) {
if ($row[$startcol] === null) {
return null;
}
return (string) $row[$startcol + 2];
return (string) $row[$startcol];
}
/**
@ -464,7 +404,7 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
public static function getPrimaryKeyFromRow($row, $startcol = 0)
{
return (int) $row[$startcol + 2];
return (int) $row[$startcol];
}
/**
@ -563,58 +503,7 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
$con = Propel::getConnection(ImportedPodcastPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(ImportedPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Returns the number of rows matching criteria, joining the related CcSubjs table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinCcSubjs(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(ImportedPodcastPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
ImportedPodcastPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(ImportedPodcastPeer::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(ImportedPodcastPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(ImportedPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$criteria->addJoin(ImportedPodcastPeer::PODCAST_ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
@ -651,7 +540,7 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
$startcol = ImportedPodcastPeer::NUM_HYDRATE_COLUMNS;
PodcastPeer::addSelectColumns($criteria);
$criteria->addJoin(ImportedPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$criteria->addJoin(ImportedPodcastPeer::PODCAST_ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
@ -684,74 +573,6 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
} // if obj2 already loaded
// Add the $obj1 (ImportedPodcast) to $obj2 (Podcast)
// one to one relationship
$obj1->setPodcast($obj2);
} // if joined row was not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Selects a collection of ImportedPodcast objects pre-filled with their CcSubjs objects.
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of ImportedPodcast objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(ImportedPodcastPeer::DATABASE_NAME);
}
ImportedPodcastPeer::addSelectColumns($criteria);
$startcol = ImportedPodcastPeer::NUM_HYDRATE_COLUMNS;
CcSubjsPeer::addSelectColumns($criteria);
$criteria->addJoin(ImportedPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = ImportedPodcastPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = ImportedPodcastPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = ImportedPodcastPeer::getOMClass();
$obj1 = new $cls();
$obj1->hydrate($row);
ImportedPodcastPeer::addInstanceToPool($obj1, $key1);
} // if $obj1 already loaded
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass();
$obj2 = new $cls();
$obj2->hydrate($row, $startcol);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if obj2 already loaded
// Add the $obj1 (ImportedPodcast) to $obj2 (CcSubjs)
$obj2->addImportedPodcast($obj1);
} // if joined row was not null
@ -800,9 +621,7 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
$con = Propel::getConnection(ImportedPodcastPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(ImportedPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$criteria->addJoin(ImportedPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$criteria->addJoin(ImportedPodcastPeer::PODCAST_ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
@ -841,12 +660,7 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
PodcastPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + PodcastPeer::NUM_HYDRATE_COLUMNS;
CcSubjsPeer::addSelectColumns($criteria);
$startcol4 = $startcol3 + CcSubjsPeer::NUM_HYDRATE_COLUMNS;
$criteria->addJoin(ImportedPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$criteria->addJoin(ImportedPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$criteria->addJoin(ImportedPodcastPeer::PODCAST_ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
@ -880,276 +694,8 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
} // if obj2 loaded
// Add the $obj1 (ImportedPodcast) to the collection in $obj2 (Podcast)
$obj1->setPodcast($obj2);
} // if joined row not null
// Add objects for joined CcSubjs rows
$key3 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol3);
if ($key3 !== null) {
$obj3 = CcSubjsPeer::getInstanceFromPool($key3);
if (!$obj3) {
$cls = CcSubjsPeer::getOMClass();
$obj3 = new $cls();
$obj3->hydrate($row, $startcol3);
CcSubjsPeer::addInstanceToPool($obj3, $key3);
} // if obj3 loaded
// Add the $obj1 (ImportedPodcast) to the collection in $obj3 (CcSubjs)
$obj3->addImportedPodcast($obj1);
} // if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining the related Podcast table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinAllExceptPodcast(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(ImportedPodcastPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
ImportedPodcastPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY should not affect count
// Set the correct dbName
$criteria->setDbName(ImportedPodcastPeer::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(ImportedPodcastPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(ImportedPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Returns the number of rows matching criteria, joining the related CcSubjs table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinAllExceptCcSubjs(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(ImportedPodcastPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
ImportedPodcastPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY should not affect count
// Set the correct dbName
$criteria->setDbName(ImportedPodcastPeer::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(ImportedPodcastPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(ImportedPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of ImportedPodcast objects pre-filled with all related objects except Podcast.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of ImportedPodcast objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAllExceptPodcast(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
// $criteria->getDbName() will return the same object if not set to another value
// so == check is okay and faster
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(ImportedPodcastPeer::DATABASE_NAME);
}
ImportedPodcastPeer::addSelectColumns($criteria);
$startcol2 = ImportedPodcastPeer::NUM_HYDRATE_COLUMNS;
CcSubjsPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + CcSubjsPeer::NUM_HYDRATE_COLUMNS;
$criteria->addJoin(ImportedPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = ImportedPodcastPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = ImportedPodcastPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = ImportedPodcastPeer::getOMClass();
$obj1 = new $cls();
$obj1->hydrate($row);
ImportedPodcastPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined CcSubjs rows
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass();
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if $obj2 already loaded
// Add the $obj1 (ImportedPodcast) to the collection in $obj2 (CcSubjs)
$obj2->addImportedPodcast($obj1);
} // if joined row is not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Selects a collection of ImportedPodcast objects pre-filled with all related objects except CcSubjs.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of ImportedPodcast objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAllExceptCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
// $criteria->getDbName() will return the same object if not set to another value
// so == check is okay and faster
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(ImportedPodcastPeer::DATABASE_NAME);
}
ImportedPodcastPeer::addSelectColumns($criteria);
$startcol2 = ImportedPodcastPeer::NUM_HYDRATE_COLUMNS;
PodcastPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + PodcastPeer::NUM_HYDRATE_COLUMNS;
$criteria->addJoin(ImportedPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = ImportedPodcastPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = ImportedPodcastPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = ImportedPodcastPeer::getOMClass();
$obj1 = new $cls();
$obj1->hydrate($row);
ImportedPodcastPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined Podcast rows
$key2 = PodcastPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = PodcastPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = PodcastPeer::getOMClass();
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
PodcastPeer::addInstanceToPool($obj2, $key2);
} // if $obj2 already loaded
// Add the $obj1 (ImportedPodcast) to the collection in $obj2 (Podcast)
$obj1->setPodcast($obj2);
} // if joined row is not null
} // if joined row not null
$results[] = $obj1;
}
@ -1213,6 +759,10 @@ abstract class BaseImportedPodcastPeer extends PodcastPeer
$criteria = $values->buildCriteria(); // build Criteria from ImportedPodcast object
}
if ($criteria->containsKey(ImportedPodcastPeer::ID) && $criteria->keyContainsValue(ImportedPodcastPeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ImportedPodcastPeer::ID.')');
}
// Set the correct dbName
$criteria->setDbName(ImportedPodcastPeer::DATABASE_NAME);

View file

@ -6,39 +6,15 @@
*
*
*
* @method ImportedPodcastQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method ImportedPodcastQuery orderByDbUrl($order = Criteria::ASC) Order by the url column
* @method ImportedPodcastQuery orderByDbAutoIngest($order = Criteria::ASC) Order by the auto_ingest column
* @method ImportedPodcastQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method ImportedPodcastQuery orderByDbTitle($order = Criteria::ASC) Order by the title column
* @method ImportedPodcastQuery orderByDbCreator($order = Criteria::ASC) Order by the creator column
* @method ImportedPodcastQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
* @method ImportedPodcastQuery orderByDbLanguage($order = Criteria::ASC) Order by the language column
* @method ImportedPodcastQuery orderByDbCopyright($order = Criteria::ASC) Order by the copyright column
* @method ImportedPodcastQuery orderByDbLink($order = Criteria::ASC) Order by the link column
* @method ImportedPodcastQuery orderByDbItunesAuthor($order = Criteria::ASC) Order by the itunes_author column
* @method ImportedPodcastQuery orderByDbItunesKeywords($order = Criteria::ASC) Order by the itunes_keywords column
* @method ImportedPodcastQuery orderByDbItunesSummary($order = Criteria::ASC) Order by the itunes_summary column
* @method ImportedPodcastQuery orderByDbItunesSubtitle($order = Criteria::ASC) Order by the itunes_subtitle column
* @method ImportedPodcastQuery orderByDbItunesCategory($order = Criteria::ASC) Order by the itunes_category column
* @method ImportedPodcastQuery orderByDbItunesExplicit($order = Criteria::ASC) Order by the itunes_explicit column
* @method ImportedPodcastQuery orderByDbOwner($order = Criteria::ASC) Order by the owner column
* @method ImportedPodcastQuery orderByDbPodcastId($order = Criteria::ASC) Order by the podcast_id column
*
* @method ImportedPodcastQuery groupByDbId() Group by the id column
* @method ImportedPodcastQuery groupByDbUrl() Group by the url column
* @method ImportedPodcastQuery groupByDbAutoIngest() Group by the auto_ingest column
* @method ImportedPodcastQuery groupByDbId() Group by the id column
* @method ImportedPodcastQuery groupByDbTitle() Group by the title column
* @method ImportedPodcastQuery groupByDbCreator() Group by the creator column
* @method ImportedPodcastQuery groupByDbDescription() Group by the description column
* @method ImportedPodcastQuery groupByDbLanguage() Group by the language column
* @method ImportedPodcastQuery groupByDbCopyright() Group by the copyright column
* @method ImportedPodcastQuery groupByDbLink() Group by the link column
* @method ImportedPodcastQuery groupByDbItunesAuthor() Group by the itunes_author column
* @method ImportedPodcastQuery groupByDbItunesKeywords() Group by the itunes_keywords column
* @method ImportedPodcastQuery groupByDbItunesSummary() Group by the itunes_summary column
* @method ImportedPodcastQuery groupByDbItunesSubtitle() Group by the itunes_subtitle column
* @method ImportedPodcastQuery groupByDbItunesCategory() Group by the itunes_category column
* @method ImportedPodcastQuery groupByDbItunesExplicit() Group by the itunes_explicit column
* @method ImportedPodcastQuery groupByDbOwner() Group by the owner column
* @method ImportedPodcastQuery groupByDbPodcastId() Group by the podcast_id column
*
* @method ImportedPodcastQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ImportedPodcastQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -48,49 +24,21 @@
* @method ImportedPodcastQuery rightJoinPodcast($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Podcast relation
* @method ImportedPodcastQuery innerJoinPodcast($relationAlias = null) Adds a INNER JOIN clause to the query using the Podcast relation
*
* @method ImportedPodcastQuery leftJoinCcSubjs($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcSubjs relation
* @method ImportedPodcastQuery rightJoinCcSubjs($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcSubjs relation
* @method ImportedPodcastQuery innerJoinCcSubjs($relationAlias = null) Adds a INNER JOIN clause to the query using the CcSubjs relation
*
* @method ImportedPodcast findOne(PropelPDO $con = null) Return the first ImportedPodcast matching the query
* @method ImportedPodcast findOneOrCreate(PropelPDO $con = null) Return the first ImportedPodcast matching the query, or a new ImportedPodcast object populated from the query conditions when no match is found
*
* @method ImportedPodcast findOneByDbUrl(string $url) Return the first ImportedPodcast filtered by the url column
* @method ImportedPodcast findOneByDbAutoIngest(boolean $auto_ingest) Return the first ImportedPodcast filtered by the auto_ingest column
* @method ImportedPodcast findOneByDbTitle(string $title) Return the first ImportedPodcast filtered by the title column
* @method ImportedPodcast findOneByDbCreator(string $creator) Return the first ImportedPodcast filtered by the creator column
* @method ImportedPodcast findOneByDbDescription(string $description) Return the first ImportedPodcast filtered by the description column
* @method ImportedPodcast findOneByDbLanguage(string $language) Return the first ImportedPodcast filtered by the language column
* @method ImportedPodcast findOneByDbCopyright(string $copyright) Return the first ImportedPodcast filtered by the copyright column
* @method ImportedPodcast findOneByDbLink(string $link) Return the first ImportedPodcast filtered by the link column
* @method ImportedPodcast findOneByDbItunesAuthor(string $itunes_author) Return the first ImportedPodcast filtered by the itunes_author column
* @method ImportedPodcast findOneByDbItunesKeywords(string $itunes_keywords) Return the first ImportedPodcast filtered by the itunes_keywords column
* @method ImportedPodcast findOneByDbItunesSummary(string $itunes_summary) Return the first ImportedPodcast filtered by the itunes_summary column
* @method ImportedPodcast findOneByDbItunesSubtitle(string $itunes_subtitle) Return the first ImportedPodcast filtered by the itunes_subtitle column
* @method ImportedPodcast findOneByDbItunesCategory(string $itunes_category) Return the first ImportedPodcast filtered by the itunes_category column
* @method ImportedPodcast findOneByDbItunesExplicit(string $itunes_explicit) Return the first ImportedPodcast filtered by the itunes_explicit column
* @method ImportedPodcast findOneByDbOwner(int $owner) Return the first ImportedPodcast filtered by the owner column
* @method ImportedPodcast findOneByDbPodcastId(int $podcast_id) Return the first ImportedPodcast filtered by the podcast_id column
*
* @method array findByDbId(int $id) Return ImportedPodcast objects filtered by the id column
* @method array findByDbUrl(string $url) Return ImportedPodcast objects filtered by the url column
* @method array findByDbAutoIngest(boolean $auto_ingest) Return ImportedPodcast objects filtered by the auto_ingest column
* @method array findByDbId(int $id) Return ImportedPodcast objects filtered by the id column
* @method array findByDbTitle(string $title) Return ImportedPodcast objects filtered by the title column
* @method array findByDbCreator(string $creator) Return ImportedPodcast objects filtered by the creator column
* @method array findByDbDescription(string $description) Return ImportedPodcast objects filtered by the description column
* @method array findByDbLanguage(string $language) Return ImportedPodcast objects filtered by the language column
* @method array findByDbCopyright(string $copyright) Return ImportedPodcast objects filtered by the copyright column
* @method array findByDbLink(string $link) Return ImportedPodcast objects filtered by the link column
* @method array findByDbItunesAuthor(string $itunes_author) Return ImportedPodcast objects filtered by the itunes_author column
* @method array findByDbItunesKeywords(string $itunes_keywords) Return ImportedPodcast objects filtered by the itunes_keywords column
* @method array findByDbItunesSummary(string $itunes_summary) Return ImportedPodcast objects filtered by the itunes_summary column
* @method array findByDbItunesSubtitle(string $itunes_subtitle) Return ImportedPodcast objects filtered by the itunes_subtitle column
* @method array findByDbItunesCategory(string $itunes_category) Return ImportedPodcast objects filtered by the itunes_category column
* @method array findByDbItunesExplicit(string $itunes_explicit) Return ImportedPodcast objects filtered by the itunes_explicit column
* @method array findByDbOwner(int $owner) Return ImportedPodcast objects filtered by the owner column
* @method array findByDbPodcastId(int $podcast_id) Return ImportedPodcast objects filtered by the podcast_id column
*
* @package propel.generator.airtime.om
*/
abstract class BaseImportedPodcastQuery extends PodcastQuery
abstract class BaseImportedPodcastQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseImportedPodcastQuery object.
@ -194,7 +142,7 @@ abstract class BaseImportedPodcastQuery extends PodcastQuery
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT "url", "auto_ingest", "id", "title", "creator", "description", "language", "copyright", "link", "itunes_author", "itunes_keywords", "itunes_summary", "itunes_subtitle", "itunes_category", "itunes_explicit", "owner" FROM "imported_podcast" WHERE "id" = :p0';
$sql = 'SELECT "id", "url", "auto_ingest", "podcast_id" FROM "imported_podcast" WHERE "id" = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@ -283,6 +231,48 @@ abstract class BaseImportedPodcastQuery extends PodcastQuery
return $this->addUsingAlias(ImportedPodcastPeer::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterByDbId(1234); // WHERE id = 1234
* $query->filterByDbId(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterByDbId(array('min' => 12)); // WHERE id >= 12
* $query->filterByDbId(array('max' => 12)); // WHERE id <= 12
* </code>
*
* @param mixed $dbId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbId($dbId = null, $comparison = null)
{
if (is_array($dbId)) {
$useMinMax = false;
if (isset($dbId['min'])) {
$this->addUsingAlias(ImportedPodcastPeer::ID, $dbId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbId['max'])) {
$this->addUsingAlias(ImportedPodcastPeer::ID, $dbId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::ID, $dbId, $comparison);
}
/**
* Filter the query on the url column
*
@ -340,19 +330,19 @@ abstract class BaseImportedPodcastQuery extends PodcastQuery
}
/**
* Filter the query on the id column
* Filter the query on the podcast_id column
*
* Example usage:
* <code>
* $query->filterByDbId(1234); // WHERE id = 1234
* $query->filterByDbId(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterByDbId(array('min' => 12)); // WHERE id >= 12
* $query->filterByDbId(array('max' => 12)); // WHERE id <= 12
* $query->filterByDbPodcastId(1234); // WHERE podcast_id = 1234
* $query->filterByDbPodcastId(array(12, 34)); // WHERE podcast_id IN (12, 34)
* $query->filterByDbPodcastId(array('min' => 12)); // WHERE podcast_id >= 12
* $query->filterByDbPodcastId(array('max' => 12)); // WHERE podcast_id <= 12
* </code>
*
* @see filterByPodcast()
*
* @param mixed $dbId The value to use as filter.
* @param mixed $dbPodcastId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@ -360,16 +350,16 @@ abstract class BaseImportedPodcastQuery extends PodcastQuery
*
* @return ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbId($dbId = null, $comparison = null)
public function filterByDbPodcastId($dbPodcastId = null, $comparison = null)
{
if (is_array($dbId)) {
if (is_array($dbPodcastId)) {
$useMinMax = false;
if (isset($dbId['min'])) {
$this->addUsingAlias(ImportedPodcastPeer::ID, $dbId['min'], Criteria::GREATER_EQUAL);
if (isset($dbPodcastId['min'])) {
$this->addUsingAlias(ImportedPodcastPeer::PODCAST_ID, $dbPodcastId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbId['max'])) {
$this->addUsingAlias(ImportedPodcastPeer::ID, $dbId['max'], Criteria::LESS_EQUAL);
if (isset($dbPodcastId['max'])) {
$this->addUsingAlias(ImportedPodcastPeer::PODCAST_ID, $dbPodcastId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@ -380,399 +370,7 @@ abstract class BaseImportedPodcastQuery extends PodcastQuery
}
}
return $this->addUsingAlias(ImportedPodcastPeer::ID, $dbId, $comparison);
}
/**
* Filter the query on the title column
*
* Example usage:
* <code>
* $query->filterByDbTitle('fooValue'); // WHERE title = 'fooValue'
* $query->filterByDbTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
* </code>
*
* @param string $dbTitle 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbTitle($dbTitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbTitle)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbTitle)) {
$dbTitle = str_replace('*', '%', $dbTitle);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::TITLE, $dbTitle, $comparison);
}
/**
* Filter the query on the creator column
*
* Example usage:
* <code>
* $query->filterByDbCreator('fooValue'); // WHERE creator = 'fooValue'
* $query->filterByDbCreator('%fooValue%'); // WHERE creator LIKE '%fooValue%'
* </code>
*
* @param string $dbCreator 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbCreator($dbCreator = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbCreator)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbCreator)) {
$dbCreator = str_replace('*', '%', $dbCreator);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::CREATOR, $dbCreator, $comparison);
}
/**
* Filter the query on the description column
*
* Example usage:
* <code>
* $query->filterByDbDescription('fooValue'); // WHERE description = 'fooValue'
* $query->filterByDbDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
* </code>
*
* @param string $dbDescription 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbDescription($dbDescription = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbDescription)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbDescription)) {
$dbDescription = str_replace('*', '%', $dbDescription);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::DESCRIPTION, $dbDescription, $comparison);
}
/**
* Filter the query on the language column
*
* Example usage:
* <code>
* $query->filterByDbLanguage('fooValue'); // WHERE language = 'fooValue'
* $query->filterByDbLanguage('%fooValue%'); // WHERE language LIKE '%fooValue%'
* </code>
*
* @param string $dbLanguage 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbLanguage($dbLanguage = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbLanguage)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbLanguage)) {
$dbLanguage = str_replace('*', '%', $dbLanguage);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::LANGUAGE, $dbLanguage, $comparison);
}
/**
* Filter the query on the copyright column
*
* Example usage:
* <code>
* $query->filterByDbCopyright('fooValue'); // WHERE copyright = 'fooValue'
* $query->filterByDbCopyright('%fooValue%'); // WHERE copyright LIKE '%fooValue%'
* </code>
*
* @param string $dbCopyright 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbCopyright($dbCopyright = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbCopyright)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbCopyright)) {
$dbCopyright = str_replace('*', '%', $dbCopyright);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::COPYRIGHT, $dbCopyright, $comparison);
}
/**
* Filter the query on the link column
*
* Example usage:
* <code>
* $query->filterByDbLink('fooValue'); // WHERE link = 'fooValue'
* $query->filterByDbLink('%fooValue%'); // WHERE link LIKE '%fooValue%'
* </code>
*
* @param string $dbLink 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbLink($dbLink = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbLink)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbLink)) {
$dbLink = str_replace('*', '%', $dbLink);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::LINK, $dbLink, $comparison);
}
/**
* Filter the query on the itunes_author column
*
* Example usage:
* <code>
* $query->filterByDbItunesAuthor('fooValue'); // WHERE itunes_author = 'fooValue'
* $query->filterByDbItunesAuthor('%fooValue%'); // WHERE itunes_author LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesAuthor 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesAuthor($dbItunesAuthor = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesAuthor)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesAuthor)) {
$dbItunesAuthor = str_replace('*', '%', $dbItunesAuthor);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::ITUNES_AUTHOR, $dbItunesAuthor, $comparison);
}
/**
* Filter the query on the itunes_keywords column
*
* Example usage:
* <code>
* $query->filterByDbItunesKeywords('fooValue'); // WHERE itunes_keywords = 'fooValue'
* $query->filterByDbItunesKeywords('%fooValue%'); // WHERE itunes_keywords LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesKeywords 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesKeywords($dbItunesKeywords = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesKeywords)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesKeywords)) {
$dbItunesKeywords = str_replace('*', '%', $dbItunesKeywords);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::ITUNES_KEYWORDS, $dbItunesKeywords, $comparison);
}
/**
* Filter the query on the itunes_summary column
*
* Example usage:
* <code>
* $query->filterByDbItunesSummary('fooValue'); // WHERE itunes_summary = 'fooValue'
* $query->filterByDbItunesSummary('%fooValue%'); // WHERE itunes_summary LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesSummary 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesSummary($dbItunesSummary = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesSummary)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesSummary)) {
$dbItunesSummary = str_replace('*', '%', $dbItunesSummary);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::ITUNES_SUMMARY, $dbItunesSummary, $comparison);
}
/**
* Filter the query on the itunes_subtitle column
*
* Example usage:
* <code>
* $query->filterByDbItunesSubtitle('fooValue'); // WHERE itunes_subtitle = 'fooValue'
* $query->filterByDbItunesSubtitle('%fooValue%'); // WHERE itunes_subtitle LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesSubtitle 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesSubtitle($dbItunesSubtitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesSubtitle)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesSubtitle)) {
$dbItunesSubtitle = str_replace('*', '%', $dbItunesSubtitle);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::ITUNES_SUBTITLE, $dbItunesSubtitle, $comparison);
}
/**
* Filter the query on the itunes_category column
*
* Example usage:
* <code>
* $query->filterByDbItunesCategory('fooValue'); // WHERE itunes_category = 'fooValue'
* $query->filterByDbItunesCategory('%fooValue%'); // WHERE itunes_category LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesCategory 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesCategory($dbItunesCategory = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesCategory)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesCategory)) {
$dbItunesCategory = str_replace('*', '%', $dbItunesCategory);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::ITUNES_CATEGORY, $dbItunesCategory, $comparison);
}
/**
* Filter the query on the itunes_explicit column
*
* Example usage:
* <code>
* $query->filterByDbItunesExplicit('fooValue'); // WHERE itunes_explicit = 'fooValue'
* $query->filterByDbItunesExplicit('%fooValue%'); // WHERE itunes_explicit LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesExplicit 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 ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesExplicit($dbItunesExplicit = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesExplicit)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesExplicit)) {
$dbItunesExplicit = str_replace('*', '%', $dbItunesExplicit);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::ITUNES_EXPLICIT, $dbItunesExplicit, $comparison);
}
/**
* Filter the query on the owner column
*
* Example usage:
* <code>
* $query->filterByDbOwner(1234); // WHERE owner = 1234
* $query->filterByDbOwner(array(12, 34)); // WHERE owner IN (12, 34)
* $query->filterByDbOwner(array('min' => 12)); // WHERE owner >= 12
* $query->filterByDbOwner(array('max' => 12)); // WHERE owner <= 12
* </code>
*
* @see filterByCcSubjs()
*
* @param mixed $dbOwner The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ImportedPodcastQuery The current query, for fluid interface
*/
public function filterByDbOwner($dbOwner = null, $comparison = null)
{
if (is_array($dbOwner)) {
$useMinMax = false;
if (isset($dbOwner['min'])) {
$this->addUsingAlias(ImportedPodcastPeer::OWNER, $dbOwner['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbOwner['max'])) {
$this->addUsingAlias(ImportedPodcastPeer::OWNER, $dbOwner['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ImportedPodcastPeer::OWNER, $dbOwner, $comparison);
return $this->addUsingAlias(ImportedPodcastPeer::PODCAST_ID, $dbPodcastId, $comparison);
}
/**
@ -788,14 +386,14 @@ abstract class BaseImportedPodcastQuery extends PodcastQuery
{
if ($podcast instanceof Podcast) {
return $this
->addUsingAlias(ImportedPodcastPeer::ID, $podcast->getDbId(), $comparison);
->addUsingAlias(ImportedPodcastPeer::PODCAST_ID, $podcast->getDbId(), $comparison);
} elseif ($podcast instanceof PropelObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ImportedPodcastPeer::ID, $podcast->toKeyValue('PrimaryKey', 'DbId'), $comparison);
->addUsingAlias(ImportedPodcastPeer::PODCAST_ID, $podcast->toKeyValue('PrimaryKey', 'DbId'), $comparison);
} else {
throw new PropelException('filterByPodcast() only accepts arguments of type Podcast or PropelCollection');
}
@ -851,82 +449,6 @@ abstract class BaseImportedPodcastQuery extends PodcastQuery
->useQuery($relationAlias ? $relationAlias : 'Podcast', 'PodcastQuery');
}
/**
* Filter the query by a related CcSubjs object
*
* @param CcSubjs|PropelObjectCollection $ccSubjs The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ImportedPodcastQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
if ($ccSubjs instanceof CcSubjs) {
return $this
->addUsingAlias(ImportedPodcastPeer::OWNER, $ccSubjs->getDbId(), $comparison);
} elseif ($ccSubjs instanceof PropelObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(ImportedPodcastPeer::OWNER, $ccSubjs->toKeyValue('PrimaryKey', 'DbId'), $comparison);
} else {
throw new PropelException('filterByCcSubjs() only accepts arguments of type CcSubjs or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the CcSubjs relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ImportedPodcastQuery The current query, for fluid interface
*/
public function joinCcSubjs($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcSubjs');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CcSubjs');
}
return $this;
}
/**
* Use the CcSubjs relation CcSubjs object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcSubjsQuery A secondary query class using the current class as primary query
*/
public function useCcSubjsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcSubjs($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery');
}
/**
* Exclude object from result
*

View file

@ -113,33 +113,29 @@ abstract class BasePodcast extends BaseObject implements Persistent
*/
protected $owner;
/**
* The value for the descendant_class field.
* @var string
*/
protected $descendant_class;
/**
* @var CcSubjs
*/
protected $aCcSubjs;
/**
* @var PropelObjectCollection|StationPodcast[] Collection to store aggregation of StationPodcast objects.
*/
protected $collStationPodcasts;
protected $collStationPodcastsPartial;
/**
* @var PropelObjectCollection|ImportedPodcast[] Collection to store aggregation of ImportedPodcast objects.
*/
protected $collImportedPodcasts;
protected $collImportedPodcastsPartial;
/**
* @var PropelObjectCollection|PodcastEpisodes[] Collection to store aggregation of PodcastEpisodes objects.
*/
protected $collPodcastEpisodess;
protected $collPodcastEpisodessPartial;
/**
* @var StationPodcast one-to-one related StationPodcast object
*/
protected $singleStationPodcast;
/**
* @var ImportedPodcast one-to-one related ImportedPodcast object
*/
protected $singleImportedPodcast;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@ -160,6 +156,18 @@ abstract class BasePodcast extends BaseObject implements Persistent
*/
protected $alreadyInClearAllReferencesDeep = false;
/**
* An array of objects scheduled for deletion.
* @var PropelObjectCollection
*/
protected $stationPodcastsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var PropelObjectCollection
*/
protected $importedPodcastsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var PropelObjectCollection
@ -320,17 +328,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
return $this->owner;
}
/**
* Get the [descendant_class] column value.
*
* @return string
*/
public function getDescendantClass()
{
return $this->descendant_class;
}
/**
* Set the value of [id] column.
*
@ -629,27 +626,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
return $this;
} // setDbOwner()
/**
* Set the value of [descendant_class] column.
*
* @param string $v new value
* @return Podcast The current object (for fluent API support)
*/
public function setDescendantClass($v)
{
if ($v !== null && is_numeric($v)) {
$v = (string) $v;
}
if ($this->descendant_class !== $v) {
$this->descendant_class = $v;
$this->modifiedColumns[] = PodcastPeer::DESCENDANT_CLASS;
}
return $this;
} // setDescendantClass()
/**
* Indicates whether the columns in this object are only set to default values.
*
@ -696,7 +672,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
$this->itunes_category = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
$this->itunes_explicit = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
$this->owner = ($row[$startcol + 13] !== null) ? (int) $row[$startcol + 13] : null;
$this->descendant_class = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null;
$this->resetModified();
$this->setNew(false);
@ -706,7 +681,7 @@ abstract class BasePodcast extends BaseObject implements Persistent
}
$this->postHydrate($row, $startcol, $rehydrate);
return $startcol + 15; // 15 = PodcastPeer::NUM_HYDRATE_COLUMNS.
return $startcol + 14; // 14 = PodcastPeer::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating Podcast object", $e);
@ -772,12 +747,12 @@ abstract class BasePodcast extends BaseObject implements Persistent
if ($deep) { // also de-associate any related objects?
$this->aCcSubjs = null;
$this->collStationPodcasts = null;
$this->collImportedPodcasts = null;
$this->collPodcastEpisodess = null;
$this->singleStationPodcast = null;
$this->singleImportedPodcast = null;
} // if (deep)
}
@ -914,6 +889,40 @@ abstract class BasePodcast extends BaseObject implements Persistent
$this->resetModified();
}
if ($this->stationPodcastsScheduledForDeletion !== null) {
if (!$this->stationPodcastsScheduledForDeletion->isEmpty()) {
StationPodcastQuery::create()
->filterByPrimaryKeys($this->stationPodcastsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->stationPodcastsScheduledForDeletion = null;
}
}
if ($this->collStationPodcasts !== null) {
foreach ($this->collStationPodcasts as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->importedPodcastsScheduledForDeletion !== null) {
if (!$this->importedPodcastsScheduledForDeletion->isEmpty()) {
ImportedPodcastQuery::create()
->filterByPrimaryKeys($this->importedPodcastsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->importedPodcastsScheduledForDeletion = null;
}
}
if ($this->collImportedPodcasts !== null) {
foreach ($this->collImportedPodcasts as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->podcastEpisodessScheduledForDeletion !== null) {
if (!$this->podcastEpisodessScheduledForDeletion->isEmpty()) {
PodcastEpisodesQuery::create()
@ -931,18 +940,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
}
}
if ($this->singleStationPodcast !== null) {
if (!$this->singleStationPodcast->isDeleted() && ($this->singleStationPodcast->isNew() || $this->singleStationPodcast->isModified())) {
$affectedRows += $this->singleStationPodcast->save($con);
}
}
if ($this->singleImportedPodcast !== null) {
if (!$this->singleImportedPodcast->isDeleted() && ($this->singleImportedPodcast->isNew() || $this->singleImportedPodcast->isModified())) {
$affectedRows += $this->singleImportedPodcast->save($con);
}
}
$this->alreadyInSave = false;
}
@ -1021,9 +1018,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
if ($this->isColumnModified(PodcastPeer::OWNER)) {
$modifiedColumns[':p' . $index++] = '"owner"';
}
if ($this->isColumnModified(PodcastPeer::DESCENDANT_CLASS)) {
$modifiedColumns[':p' . $index++] = '"descendant_class"';
}
$sql = sprintf(
'INSERT INTO "podcast" (%s) VALUES (%s)',
@ -1077,9 +1071,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
case '"owner"':
$stmt->bindValue($identifier, $this->owner, PDO::PARAM_INT);
break;
case '"descendant_class"':
$stmt->bindValue($identifier, $this->descendant_class, PDO::PARAM_STR);
break;
}
}
$stmt->execute();
@ -1184,23 +1175,27 @@ abstract class BasePodcast extends BaseObject implements Persistent
}
if ($this->collPodcastEpisodess !== null) {
foreach ($this->collPodcastEpisodess as $referrerFK) {
if ($this->collStationPodcasts !== null) {
foreach ($this->collStationPodcasts as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
if ($this->singleStationPodcast !== null) {
if (!$this->singleStationPodcast->validate($columns)) {
$failureMap = array_merge($failureMap, $this->singleStationPodcast->getValidationFailures());
if ($this->collImportedPodcasts !== null) {
foreach ($this->collImportedPodcasts as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
if ($this->singleImportedPodcast !== null) {
if (!$this->singleImportedPodcast->validate($columns)) {
$failureMap = array_merge($failureMap, $this->singleImportedPodcast->getValidationFailures());
if ($this->collPodcastEpisodess !== null) {
foreach ($this->collPodcastEpisodess as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
@ -1281,9 +1276,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
case 13:
return $this->getDbOwner();
break;
case 14:
return $this->getDescendantClass();
break;
default:
return null;
break;
@ -1327,7 +1319,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
$keys[11] => $this->getDbItunesCategory(),
$keys[12] => $this->getDbItunesExplicit(),
$keys[13] => $this->getDbOwner(),
$keys[14] => $this->getDescendantClass(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@ -1338,15 +1329,15 @@ abstract class BasePodcast extends BaseObject implements Persistent
if (null !== $this->aCcSubjs) {
$result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->collStationPodcasts) {
$result['StationPodcasts'] = $this->collStationPodcasts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collImportedPodcasts) {
$result['ImportedPodcasts'] = $this->collImportedPodcasts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collPodcastEpisodess) {
$result['PodcastEpisodess'] = $this->collPodcastEpisodess->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->singleStationPodcast) {
$result['StationPodcast'] = $this->singleStationPodcast->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->singleImportedPodcast) {
$result['ImportedPodcast'] = $this->singleImportedPodcast->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
return $result;
@ -1423,9 +1414,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
case 13:
$this->setDbOwner($value);
break;
case 14:
$this->setDescendantClass($value);
break;
} // switch()
}
@ -1464,7 +1452,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
if (array_key_exists($keys[11], $arr)) $this->setDbItunesCategory($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setDbItunesExplicit($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setDbOwner($arr[$keys[13]]);
if (array_key_exists($keys[14], $arr)) $this->setDescendantClass($arr[$keys[14]]);
}
/**
@ -1490,7 +1477,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
if ($this->isColumnModified(PodcastPeer::ITUNES_CATEGORY)) $criteria->add(PodcastPeer::ITUNES_CATEGORY, $this->itunes_category);
if ($this->isColumnModified(PodcastPeer::ITUNES_EXPLICIT)) $criteria->add(PodcastPeer::ITUNES_EXPLICIT, $this->itunes_explicit);
if ($this->isColumnModified(PodcastPeer::OWNER)) $criteria->add(PodcastPeer::OWNER, $this->owner);
if ($this->isColumnModified(PodcastPeer::DESCENDANT_CLASS)) $criteria->add(PodcastPeer::DESCENDANT_CLASS, $this->descendant_class);
return $criteria;
}
@ -1567,7 +1553,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
$copyObj->setDbItunesCategory($this->getDbItunesCategory());
$copyObj->setDbItunesExplicit($this->getDbItunesExplicit());
$copyObj->setDbOwner($this->getDbOwner());
$copyObj->setDescendantClass($this->getDescendantClass());
if ($deepCopy && !$this->startCopy) {
// important: temporarily setNew(false) because this affects the behavior of
@ -1576,22 +1561,24 @@ abstract class BasePodcast extends BaseObject implements Persistent
// store object hash to prevent cycle
$this->startCopy = true;
foreach ($this->getStationPodcasts() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addStationPodcast($relObj->copy($deepCopy));
}
}
foreach ($this->getImportedPodcasts() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addImportedPodcast($relObj->copy($deepCopy));
}
}
foreach ($this->getPodcastEpisodess() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addPodcastEpisodes($relObj->copy($deepCopy));
}
}
$relObj = $this->getStationPodcast();
if ($relObj) {
$copyObj->setStationPodcast($relObj->copy($deepCopy));
}
$relObj = $this->getImportedPodcast();
if ($relObj) {
$copyObj->setImportedPodcast($relObj->copy($deepCopy));
}
//unflag object copy
$this->startCopy = false;
} // if ($deepCopy)
@ -1705,11 +1692,467 @@ abstract class BasePodcast extends BaseObject implements Persistent
*/
public function initRelation($relationName)
{
if ('StationPodcast' == $relationName) {
$this->initStationPodcasts();
}
if ('ImportedPodcast' == $relationName) {
$this->initImportedPodcasts();
}
if ('PodcastEpisodes' == $relationName) {
$this->initPodcastEpisodess();
}
}
/**
* Clears out the collStationPodcasts collection
*
* This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method.
*
* @return Podcast The current object (for fluent API support)
* @see addStationPodcasts()
*/
public function clearStationPodcasts()
{
$this->collStationPodcasts = null; // important to set this to null since that means it is uninitialized
$this->collStationPodcastsPartial = null;
return $this;
}
/**
* reset is the collStationPodcasts collection loaded partially
*
* @return void
*/
public function resetPartialStationPodcasts($v = true)
{
$this->collStationPodcastsPartial = $v;
}
/**
* Initializes the collStationPodcasts collection.
*
* By default this just sets the collStationPodcasts collection to an empty array (like clearcollStationPodcasts());
* 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.
*
* @param boolean $overrideExisting If set to true, the method call initializes
* the collection even if it is not empty
*
* @return void
*/
public function initStationPodcasts($overrideExisting = true)
{
if (null !== $this->collStationPodcasts && !$overrideExisting) {
return;
}
$this->collStationPodcasts = new PropelObjectCollection();
$this->collStationPodcasts->setModel('StationPodcast');
}
/**
* Gets an array of StationPodcast objects which contain a foreign key that references this object.
*
* If the $criteria is not null, it is used to always fetch the results from the database.
* Otherwise the results are fetched from the database the first time, then cached.
* Next time the same method is called without $criteria, the cached collection is returned.
* If this Podcast is new, it will return
* an empty collection or the current collection; the criteria is ignored on a new object.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
* @return PropelObjectCollection|StationPodcast[] List of StationPodcast objects
* @throws PropelException
*/
public function getStationPodcasts($criteria = null, PropelPDO $con = null)
{
$partial = $this->collStationPodcastsPartial && !$this->isNew();
if (null === $this->collStationPodcasts || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collStationPodcasts) {
// return empty collection
$this->initStationPodcasts();
} else {
$collStationPodcasts = StationPodcastQuery::create(null, $criteria)
->filterByPodcast($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collStationPodcastsPartial && count($collStationPodcasts)) {
$this->initStationPodcasts(false);
foreach ($collStationPodcasts as $obj) {
if (false == $this->collStationPodcasts->contains($obj)) {
$this->collStationPodcasts->append($obj);
}
}
$this->collStationPodcastsPartial = true;
}
$collStationPodcasts->getInternalIterator()->rewind();
return $collStationPodcasts;
}
if ($partial && $this->collStationPodcasts) {
foreach ($this->collStationPodcasts as $obj) {
if ($obj->isNew()) {
$collStationPodcasts[] = $obj;
}
}
}
$this->collStationPodcasts = $collStationPodcasts;
$this->collStationPodcastsPartial = false;
}
}
return $this->collStationPodcasts;
}
/**
* Sets a collection of StationPodcast objects related by a one-to-many relationship
* to the current object.
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
* and new objects from the given Propel collection.
*
* @param PropelCollection $stationPodcasts A Propel collection.
* @param PropelPDO $con Optional connection object
* @return Podcast The current object (for fluent API support)
*/
public function setStationPodcasts(PropelCollection $stationPodcasts, PropelPDO $con = null)
{
$stationPodcastsToDelete = $this->getStationPodcasts(new Criteria(), $con)->diff($stationPodcasts);
$this->stationPodcastsScheduledForDeletion = $stationPodcastsToDelete;
foreach ($stationPodcastsToDelete as $stationPodcastRemoved) {
$stationPodcastRemoved->setPodcast(null);
}
$this->collStationPodcasts = null;
foreach ($stationPodcasts as $stationPodcast) {
$this->addStationPodcast($stationPodcast);
}
$this->collStationPodcasts = $stationPodcasts;
$this->collStationPodcastsPartial = false;
return $this;
}
/**
* Returns the number of related StationPodcast objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param PropelPDO $con
* @return int Count of related StationPodcast objects.
* @throws PropelException
*/
public function countStationPodcasts(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
$partial = $this->collStationPodcastsPartial && !$this->isNew();
if (null === $this->collStationPodcasts || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collStationPodcasts) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getStationPodcasts());
}
$query = StationPodcastQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByPodcast($this)
->count($con);
}
return count($this->collStationPodcasts);
}
/**
* Method called to associate a StationPodcast object to this object
* through the StationPodcast foreign key attribute.
*
* @param StationPodcast $l StationPodcast
* @return Podcast The current object (for fluent API support)
*/
public function addStationPodcast(StationPodcast $l)
{
if ($this->collStationPodcasts === null) {
$this->initStationPodcasts();
$this->collStationPodcastsPartial = true;
}
if (!in_array($l, $this->collStationPodcasts->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddStationPodcast($l);
if ($this->stationPodcastsScheduledForDeletion and $this->stationPodcastsScheduledForDeletion->contains($l)) {
$this->stationPodcastsScheduledForDeletion->remove($this->stationPodcastsScheduledForDeletion->search($l));
}
}
return $this;
}
/**
* @param StationPodcast $stationPodcast The stationPodcast object to add.
*/
protected function doAddStationPodcast($stationPodcast)
{
$this->collStationPodcasts[]= $stationPodcast;
$stationPodcast->setPodcast($this);
}
/**
* @param StationPodcast $stationPodcast The stationPodcast object to remove.
* @return Podcast The current object (for fluent API support)
*/
public function removeStationPodcast($stationPodcast)
{
if ($this->getStationPodcasts()->contains($stationPodcast)) {
$this->collStationPodcasts->remove($this->collStationPodcasts->search($stationPodcast));
if (null === $this->stationPodcastsScheduledForDeletion) {
$this->stationPodcastsScheduledForDeletion = clone $this->collStationPodcasts;
$this->stationPodcastsScheduledForDeletion->clear();
}
$this->stationPodcastsScheduledForDeletion[]= clone $stationPodcast;
$stationPodcast->setPodcast(null);
}
return $this;
}
/**
* Clears out the collImportedPodcasts collection
*
* This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method.
*
* @return Podcast The current object (for fluent API support)
* @see addImportedPodcasts()
*/
public function clearImportedPodcasts()
{
$this->collImportedPodcasts = null; // important to set this to null since that means it is uninitialized
$this->collImportedPodcastsPartial = null;
return $this;
}
/**
* reset is the collImportedPodcasts collection loaded partially
*
* @return void
*/
public function resetPartialImportedPodcasts($v = true)
{
$this->collImportedPodcastsPartial = $v;
}
/**
* Initializes the collImportedPodcasts collection.
*
* By default this just sets the collImportedPodcasts collection to an empty array (like clearcollImportedPodcasts());
* 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.
*
* @param boolean $overrideExisting If set to true, the method call initializes
* the collection even if it is not empty
*
* @return void
*/
public function initImportedPodcasts($overrideExisting = true)
{
if (null !== $this->collImportedPodcasts && !$overrideExisting) {
return;
}
$this->collImportedPodcasts = new PropelObjectCollection();
$this->collImportedPodcasts->setModel('ImportedPodcast');
}
/**
* Gets an array of ImportedPodcast objects which contain a foreign key that references this object.
*
* If the $criteria is not null, it is used to always fetch the results from the database.
* Otherwise the results are fetched from the database the first time, then cached.
* Next time the same method is called without $criteria, the cached collection is returned.
* If this Podcast is new, it will return
* an empty collection or the current collection; the criteria is ignored on a new object.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
* @return PropelObjectCollection|ImportedPodcast[] List of ImportedPodcast objects
* @throws PropelException
*/
public function getImportedPodcasts($criteria = null, PropelPDO $con = null)
{
$partial = $this->collImportedPodcastsPartial && !$this->isNew();
if (null === $this->collImportedPodcasts || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collImportedPodcasts) {
// return empty collection
$this->initImportedPodcasts();
} else {
$collImportedPodcasts = ImportedPodcastQuery::create(null, $criteria)
->filterByPodcast($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collImportedPodcastsPartial && count($collImportedPodcasts)) {
$this->initImportedPodcasts(false);
foreach ($collImportedPodcasts as $obj) {
if (false == $this->collImportedPodcasts->contains($obj)) {
$this->collImportedPodcasts->append($obj);
}
}
$this->collImportedPodcastsPartial = true;
}
$collImportedPodcasts->getInternalIterator()->rewind();
return $collImportedPodcasts;
}
if ($partial && $this->collImportedPodcasts) {
foreach ($this->collImportedPodcasts as $obj) {
if ($obj->isNew()) {
$collImportedPodcasts[] = $obj;
}
}
}
$this->collImportedPodcasts = $collImportedPodcasts;
$this->collImportedPodcastsPartial = false;
}
}
return $this->collImportedPodcasts;
}
/**
* Sets a collection of ImportedPodcast objects related by a one-to-many relationship
* to the current object.
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
* and new objects from the given Propel collection.
*
* @param PropelCollection $importedPodcasts A Propel collection.
* @param PropelPDO $con Optional connection object
* @return Podcast The current object (for fluent API support)
*/
public function setImportedPodcasts(PropelCollection $importedPodcasts, PropelPDO $con = null)
{
$importedPodcastsToDelete = $this->getImportedPodcasts(new Criteria(), $con)->diff($importedPodcasts);
$this->importedPodcastsScheduledForDeletion = $importedPodcastsToDelete;
foreach ($importedPodcastsToDelete as $importedPodcastRemoved) {
$importedPodcastRemoved->setPodcast(null);
}
$this->collImportedPodcasts = null;
foreach ($importedPodcasts as $importedPodcast) {
$this->addImportedPodcast($importedPodcast);
}
$this->collImportedPodcasts = $importedPodcasts;
$this->collImportedPodcastsPartial = false;
return $this;
}
/**
* Returns the number of related ImportedPodcast objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param PropelPDO $con
* @return int Count of related ImportedPodcast objects.
* @throws PropelException
*/
public function countImportedPodcasts(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
$partial = $this->collImportedPodcastsPartial && !$this->isNew();
if (null === $this->collImportedPodcasts || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collImportedPodcasts) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getImportedPodcasts());
}
$query = ImportedPodcastQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByPodcast($this)
->count($con);
}
return count($this->collImportedPodcasts);
}
/**
* Method called to associate a ImportedPodcast object to this object
* through the ImportedPodcast foreign key attribute.
*
* @param ImportedPodcast $l ImportedPodcast
* @return Podcast The current object (for fluent API support)
*/
public function addImportedPodcast(ImportedPodcast $l)
{
if ($this->collImportedPodcasts === null) {
$this->initImportedPodcasts();
$this->collImportedPodcastsPartial = true;
}
if (!in_array($l, $this->collImportedPodcasts->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddImportedPodcast($l);
if ($this->importedPodcastsScheduledForDeletion and $this->importedPodcastsScheduledForDeletion->contains($l)) {
$this->importedPodcastsScheduledForDeletion->remove($this->importedPodcastsScheduledForDeletion->search($l));
}
}
return $this;
}
/**
* @param ImportedPodcast $importedPodcast The importedPodcast object to add.
*/
protected function doAddImportedPodcast($importedPodcast)
{
$this->collImportedPodcasts[]= $importedPodcast;
$importedPodcast->setPodcast($this);
}
/**
* @param ImportedPodcast $importedPodcast The importedPodcast object to remove.
* @return Podcast The current object (for fluent API support)
*/
public function removeImportedPodcast($importedPodcast)
{
if ($this->getImportedPodcasts()->contains($importedPodcast)) {
$this->collImportedPodcasts->remove($this->collImportedPodcasts->search($importedPodcast));
if (null === $this->importedPodcastsScheduledForDeletion) {
$this->importedPodcastsScheduledForDeletion = clone $this->collImportedPodcasts;
$this->importedPodcastsScheduledForDeletion->clear();
}
$this->importedPodcastsScheduledForDeletion[]= clone $importedPodcast;
$importedPodcast->setPodcast(null);
}
return $this;
}
/**
* Clears out the collPodcastEpisodess collection
*
@ -1960,78 +2403,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
return $this->getPodcastEpisodess($query, $con);
}
/**
* Gets a single StationPodcast object, which is related to this object by a one-to-one relationship.
*
* @param PropelPDO $con optional connection object
* @return StationPodcast
* @throws PropelException
*/
public function getStationPodcast(PropelPDO $con = null)
{
if ($this->singleStationPodcast === null && !$this->isNew()) {
$this->singleStationPodcast = StationPodcastQuery::create()->findPk($this->getPrimaryKey(), $con);
}
return $this->singleStationPodcast;
}
/**
* Sets a single StationPodcast object as related to this object by a one-to-one relationship.
*
* @param StationPodcast $v StationPodcast
* @return Podcast The current object (for fluent API support)
* @throws PropelException
*/
public function setStationPodcast(StationPodcast $v = null)
{
$this->singleStationPodcast = $v;
// Make sure that that the passed-in StationPodcast isn't already associated with this object
if ($v !== null && $v->getPodcast(null, false) === null) {
$v->setPodcast($this);
}
return $this;
}
/**
* Gets a single ImportedPodcast object, which is related to this object by a one-to-one relationship.
*
* @param PropelPDO $con optional connection object
* @return ImportedPodcast
* @throws PropelException
*/
public function getImportedPodcast(PropelPDO $con = null)
{
if ($this->singleImportedPodcast === null && !$this->isNew()) {
$this->singleImportedPodcast = ImportedPodcastQuery::create()->findPk($this->getPrimaryKey(), $con);
}
return $this->singleImportedPodcast;
}
/**
* Sets a single ImportedPodcast object as related to this object by a one-to-one relationship.
*
* @param ImportedPodcast $v ImportedPodcast
* @return Podcast The current object (for fluent API support)
* @throws PropelException
*/
public function setImportedPodcast(ImportedPodcast $v = null)
{
$this->singleImportedPodcast = $v;
// Make sure that that the passed-in ImportedPodcast isn't already associated with this object
if ($v !== null && $v->getPodcast(null, false) === null) {
$v->setPodcast($this);
}
return $this;
}
/**
* Clears the current object and sets all attributes to their default values
*/
@ -2051,7 +2422,6 @@ abstract class BasePodcast extends BaseObject implements Persistent
$this->itunes_category = null;
$this->itunes_explicit = null;
$this->owner = null;
$this->descendant_class = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->alreadyInClearAllReferencesDeep = false;
@ -2074,17 +2444,21 @@ abstract class BasePodcast extends BaseObject implements Persistent
{
if ($deep && !$this->alreadyInClearAllReferencesDeep) {
$this->alreadyInClearAllReferencesDeep = true;
if ($this->collStationPodcasts) {
foreach ($this->collStationPodcasts as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collImportedPodcasts) {
foreach ($this->collImportedPodcasts as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collPodcastEpisodess) {
foreach ($this->collPodcastEpisodess as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->singleStationPodcast) {
$this->singleStationPodcast->clearAllReferences($deep);
}
if ($this->singleImportedPodcast) {
$this->singleImportedPodcast->clearAllReferences($deep);
}
if ($this->aCcSubjs instanceof Persistent) {
$this->aCcSubjs->clearAllReferences($deep);
}
@ -2092,18 +2466,18 @@ abstract class BasePodcast extends BaseObject implements Persistent
$this->alreadyInClearAllReferencesDeep = false;
} // if ($deep)
if ($this->collStationPodcasts instanceof PropelCollection) {
$this->collStationPodcasts->clearIterator();
}
$this->collStationPodcasts = null;
if ($this->collImportedPodcasts instanceof PropelCollection) {
$this->collImportedPodcasts->clearIterator();
}
$this->collImportedPodcasts = null;
if ($this->collPodcastEpisodess instanceof PropelCollection) {
$this->collPodcastEpisodess->clearIterator();
}
$this->collPodcastEpisodess = null;
if ($this->singleStationPodcast instanceof PropelCollection) {
$this->singleStationPodcast->clearIterator();
}
$this->singleStationPodcast = null;
if ($this->singleImportedPodcast instanceof PropelCollection) {
$this->singleImportedPodcast->clearIterator();
}
$this->singleImportedPodcast = null;
$this->aCcSubjs = null;
}
@ -2127,32 +2501,4 @@ abstract class BasePodcast extends BaseObject implements Persistent
return $this->alreadyInSave;
}
// concrete_inheritance_parent behavior
/**
* Whether or not this object is the parent of a child object
*
* @return bool
*/
public function hasChildObject()
{
return $this->getDescendantClass() !== null;
}
/**
* Get the child object of this object
*
* @return mixed
*/
public function getChildObject()
{
if (!$this->hasChildObject()) {
return null;
}
$childObjectClass = $this->getDescendantClass();
$childObject = PropelQuery::from($childObjectClass)->findPk($this->getPrimaryKey());
return $childObject->hasChildObject() ? $childObject->getChildObject() : $childObject;
}
}

View file

@ -18,19 +18,19 @@ abstract class BasePodcastPeer
const TABLE_NAME = 'podcast';
/** the related Propel class for this table */
const OM_CLASS = '';
const OM_CLASS = 'Podcast';
/** the related TableMap class for this table */
const TM_CLASS = 'PodcastTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 15;
const NUM_COLUMNS = 14;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */
const NUM_HYDRATE_COLUMNS = 15;
const NUM_HYDRATE_COLUMNS = 14;
/** the column name for the id field */
const ID = 'podcast.id';
@ -74,9 +74,6 @@ abstract class BasePodcastPeer
/** the column name for the owner field */
const OWNER = 'podcast.owner';
/** the column name for the descendant_class field */
const DESCENDANT_CLASS = 'podcast.descendant_class';
/** The default string format for model objects of the related table **/
const DEFAULT_STRING_FORMAT = 'YAML';
@ -96,12 +93,12 @@ abstract class BasePodcastPeer
* e.g. PodcastPeer::$fieldNames[PodcastPeer::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbTitle', 'DbCreator', 'DbDescription', 'DbLanguage', 'DbCopyright', 'DbLink', 'DbItunesAuthor', 'DbItunesKeywords', 'DbItunesSummary', 'DbItunesSubtitle', 'DbItunesCategory', 'DbItunesExplicit', 'DbOwner', 'DescendantClass', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbTitle', 'dbCreator', 'dbDescription', 'dbLanguage', 'dbCopyright', 'dbLink', 'dbItunesAuthor', 'dbItunesKeywords', 'dbItunesSummary', 'dbItunesSubtitle', 'dbItunesCategory', 'dbItunesExplicit', 'dbOwner', 'descendantClass', ),
BasePeer::TYPE_COLNAME => array (PodcastPeer::ID, PodcastPeer::TITLE, PodcastPeer::CREATOR, PodcastPeer::DESCRIPTION, PodcastPeer::LANGUAGE, PodcastPeer::COPYRIGHT, PodcastPeer::LINK, PodcastPeer::ITUNES_AUTHOR, PodcastPeer::ITUNES_KEYWORDS, PodcastPeer::ITUNES_SUMMARY, PodcastPeer::ITUNES_SUBTITLE, PodcastPeer::ITUNES_CATEGORY, PodcastPeer::ITUNES_EXPLICIT, PodcastPeer::OWNER, PodcastPeer::DESCENDANT_CLASS, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'TITLE', 'CREATOR', 'DESCRIPTION', 'LANGUAGE', 'COPYRIGHT', 'LINK', 'ITUNES_AUTHOR', 'ITUNES_KEYWORDS', 'ITUNES_SUMMARY', 'ITUNES_SUBTITLE', 'ITUNES_CATEGORY', 'ITUNES_EXPLICIT', 'OWNER', 'DESCENDANT_CLASS', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'title', 'creator', 'description', 'language', 'copyright', 'link', 'itunes_author', 'itunes_keywords', 'itunes_summary', 'itunes_subtitle', 'itunes_category', 'itunes_explicit', 'owner', 'descendant_class', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbTitle', 'DbCreator', 'DbDescription', 'DbLanguage', 'DbCopyright', 'DbLink', 'DbItunesAuthor', 'DbItunesKeywords', 'DbItunesSummary', 'DbItunesSubtitle', 'DbItunesCategory', 'DbItunesExplicit', 'DbOwner', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbTitle', 'dbCreator', 'dbDescription', 'dbLanguage', 'dbCopyright', 'dbLink', 'dbItunesAuthor', 'dbItunesKeywords', 'dbItunesSummary', 'dbItunesSubtitle', 'dbItunesCategory', 'dbItunesExplicit', 'dbOwner', ),
BasePeer::TYPE_COLNAME => array (PodcastPeer::ID, PodcastPeer::TITLE, PodcastPeer::CREATOR, PodcastPeer::DESCRIPTION, PodcastPeer::LANGUAGE, PodcastPeer::COPYRIGHT, PodcastPeer::LINK, PodcastPeer::ITUNES_AUTHOR, PodcastPeer::ITUNES_KEYWORDS, PodcastPeer::ITUNES_SUMMARY, PodcastPeer::ITUNES_SUBTITLE, PodcastPeer::ITUNES_CATEGORY, PodcastPeer::ITUNES_EXPLICIT, PodcastPeer::OWNER, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'TITLE', 'CREATOR', 'DESCRIPTION', 'LANGUAGE', 'COPYRIGHT', 'LINK', 'ITUNES_AUTHOR', 'ITUNES_KEYWORDS', 'ITUNES_SUMMARY', 'ITUNES_SUBTITLE', 'ITUNES_CATEGORY', 'ITUNES_EXPLICIT', 'OWNER', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'title', 'creator', 'description', 'language', 'copyright', 'link', 'itunes_author', 'itunes_keywords', 'itunes_summary', 'itunes_subtitle', 'itunes_category', 'itunes_explicit', 'owner', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
);
/**
@ -111,12 +108,12 @@ abstract class BasePodcastPeer
* e.g. PodcastPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbTitle' => 1, 'DbCreator' => 2, 'DbDescription' => 3, 'DbLanguage' => 4, 'DbCopyright' => 5, 'DbLink' => 6, 'DbItunesAuthor' => 7, 'DbItunesKeywords' => 8, 'DbItunesSummary' => 9, 'DbItunesSubtitle' => 10, 'DbItunesCategory' => 11, 'DbItunesExplicit' => 12, 'DbOwner' => 13, 'DescendantClass' => 14, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbTitle' => 1, 'dbCreator' => 2, 'dbDescription' => 3, 'dbLanguage' => 4, 'dbCopyright' => 5, 'dbLink' => 6, 'dbItunesAuthor' => 7, 'dbItunesKeywords' => 8, 'dbItunesSummary' => 9, 'dbItunesSubtitle' => 10, 'dbItunesCategory' => 11, 'dbItunesExplicit' => 12, 'dbOwner' => 13, 'descendantClass' => 14, ),
BasePeer::TYPE_COLNAME => array (PodcastPeer::ID => 0, PodcastPeer::TITLE => 1, PodcastPeer::CREATOR => 2, PodcastPeer::DESCRIPTION => 3, PodcastPeer::LANGUAGE => 4, PodcastPeer::COPYRIGHT => 5, PodcastPeer::LINK => 6, PodcastPeer::ITUNES_AUTHOR => 7, PodcastPeer::ITUNES_KEYWORDS => 8, PodcastPeer::ITUNES_SUMMARY => 9, PodcastPeer::ITUNES_SUBTITLE => 10, PodcastPeer::ITUNES_CATEGORY => 11, PodcastPeer::ITUNES_EXPLICIT => 12, PodcastPeer::OWNER => 13, PodcastPeer::DESCENDANT_CLASS => 14, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'TITLE' => 1, 'CREATOR' => 2, 'DESCRIPTION' => 3, 'LANGUAGE' => 4, 'COPYRIGHT' => 5, 'LINK' => 6, 'ITUNES_AUTHOR' => 7, 'ITUNES_KEYWORDS' => 8, 'ITUNES_SUMMARY' => 9, 'ITUNES_SUBTITLE' => 10, 'ITUNES_CATEGORY' => 11, 'ITUNES_EXPLICIT' => 12, 'OWNER' => 13, 'DESCENDANT_CLASS' => 14, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'title' => 1, 'creator' => 2, 'description' => 3, 'language' => 4, 'copyright' => 5, 'link' => 6, 'itunes_author' => 7, 'itunes_keywords' => 8, 'itunes_summary' => 9, 'itunes_subtitle' => 10, 'itunes_category' => 11, 'itunes_explicit' => 12, 'owner' => 13, 'descendant_class' => 14, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbTitle' => 1, 'DbCreator' => 2, 'DbDescription' => 3, 'DbLanguage' => 4, 'DbCopyright' => 5, 'DbLink' => 6, 'DbItunesAuthor' => 7, 'DbItunesKeywords' => 8, 'DbItunesSummary' => 9, 'DbItunesSubtitle' => 10, 'DbItunesCategory' => 11, 'DbItunesExplicit' => 12, 'DbOwner' => 13, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbTitle' => 1, 'dbCreator' => 2, 'dbDescription' => 3, 'dbLanguage' => 4, 'dbCopyright' => 5, 'dbLink' => 6, 'dbItunesAuthor' => 7, 'dbItunesKeywords' => 8, 'dbItunesSummary' => 9, 'dbItunesSubtitle' => 10, 'dbItunesCategory' => 11, 'dbItunesExplicit' => 12, 'dbOwner' => 13, ),
BasePeer::TYPE_COLNAME => array (PodcastPeer::ID => 0, PodcastPeer::TITLE => 1, PodcastPeer::CREATOR => 2, PodcastPeer::DESCRIPTION => 3, PodcastPeer::LANGUAGE => 4, PodcastPeer::COPYRIGHT => 5, PodcastPeer::LINK => 6, PodcastPeer::ITUNES_AUTHOR => 7, PodcastPeer::ITUNES_KEYWORDS => 8, PodcastPeer::ITUNES_SUMMARY => 9, PodcastPeer::ITUNES_SUBTITLE => 10, PodcastPeer::ITUNES_CATEGORY => 11, PodcastPeer::ITUNES_EXPLICIT => 12, PodcastPeer::OWNER => 13, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'TITLE' => 1, 'CREATOR' => 2, 'DESCRIPTION' => 3, 'LANGUAGE' => 4, 'COPYRIGHT' => 5, 'LINK' => 6, 'ITUNES_AUTHOR' => 7, 'ITUNES_KEYWORDS' => 8, 'ITUNES_SUMMARY' => 9, 'ITUNES_SUBTITLE' => 10, 'ITUNES_CATEGORY' => 11, 'ITUNES_EXPLICIT' => 12, 'OWNER' => 13, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'title' => 1, 'creator' => 2, 'description' => 3, 'language' => 4, 'copyright' => 5, 'link' => 6, 'itunes_author' => 7, 'itunes_keywords' => 8, 'itunes_summary' => 9, 'itunes_subtitle' => 10, 'itunes_category' => 11, 'itunes_explicit' => 12, 'owner' => 13, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
);
/**
@ -204,7 +201,6 @@ abstract class BasePodcastPeer
$criteria->addSelectColumn(PodcastPeer::ITUNES_CATEGORY);
$criteria->addSelectColumn(PodcastPeer::ITUNES_EXPLICIT);
$criteria->addSelectColumn(PodcastPeer::OWNER);
$criteria->addSelectColumn(PodcastPeer::DESCENDANT_CLASS);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.title');
@ -220,7 +216,6 @@ abstract class BasePodcastPeer
$criteria->addSelectColumn($alias . '.itunes_category');
$criteria->addSelectColumn($alias . '.itunes_explicit');
$criteria->addSelectColumn($alias . '.owner');
$criteria->addSelectColumn($alias . '.descendant_class');
}
}
@ -425,15 +420,15 @@ abstract class BasePodcastPeer
*/
public static function clearRelatedInstancePool()
{
// Invalidate objects in PodcastEpisodesPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
PodcastEpisodesPeer::clearInstancePool();
// Invalidate objects in StationPodcastPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
StationPodcastPeer::clearInstancePool();
// Invalidate objects in ImportedPodcastPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
ImportedPodcastPeer::clearInstancePool();
// Invalidate objects in PodcastEpisodesPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
PodcastEpisodesPeer::clearInstancePool();
}
/**
@ -520,11 +515,6 @@ abstract class BasePodcastPeer
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $startcol, true); // rehydrate
$col = $startcol + PodcastPeer::NUM_HYDRATE_COLUMNS;
} elseif (null == $key) {
// empty resultset, probably from a left join
// since this table is abstract, we can't hydrate an empty object
$obj = null;
$col = $startcol + PodcastPeer::NUM_HYDRATE_COLUMNS;
} else {
$cls = PodcastPeer::OM_CLASS;
$obj = new $cls();
@ -799,10 +789,13 @@ abstract class BasePodcastPeer
/**
* The class that the Peer will make instances of.
*
* This method must be overridden by the stub subclass, because
* Podcast is declared abstract in the schema.
*
* @return string ClassName
*/
abstract public static function getOMClass($row = 0, $colnum = 0);
public static function getOMClass($row = 0, $colnum = 0)
{
return PodcastPeer::OM_CLASS;
}
/**
* Performs an INSERT on the database, given a Podcast or Criteria object.

View file

@ -20,7 +20,6 @@
* @method PodcastQuery orderByDbItunesCategory($order = Criteria::ASC) Order by the itunes_category column
* @method PodcastQuery orderByDbItunesExplicit($order = Criteria::ASC) Order by the itunes_explicit column
* @method PodcastQuery orderByDbOwner($order = Criteria::ASC) Order by the owner column
* @method PodcastQuery orderByDescendantClass($order = Criteria::ASC) Order by the descendant_class column
*
* @method PodcastQuery groupByDbId() Group by the id column
* @method PodcastQuery groupByDbTitle() Group by the title column
@ -36,7 +35,6 @@
* @method PodcastQuery groupByDbItunesCategory() Group by the itunes_category column
* @method PodcastQuery groupByDbItunesExplicit() Group by the itunes_explicit column
* @method PodcastQuery groupByDbOwner() Group by the owner column
* @method PodcastQuery groupByDescendantClass() Group by the descendant_class column
*
* @method PodcastQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method PodcastQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -46,10 +44,6 @@
* @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 leftJoinPodcastEpisodes($relationAlias = null) Adds a LEFT JOIN clause to the query using the PodcastEpisodes relation
* @method PodcastQuery rightJoinPodcastEpisodes($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PodcastEpisodes relation
* @method PodcastQuery innerJoinPodcastEpisodes($relationAlias = null) Adds a INNER JOIN clause to the query using the PodcastEpisodes relation
*
* @method PodcastQuery leftJoinStationPodcast($relationAlias = null) Adds a LEFT JOIN clause to the query using the StationPodcast relation
* @method PodcastQuery rightJoinStationPodcast($relationAlias = null) Adds a RIGHT JOIN clause to the query using the StationPodcast relation
* @method PodcastQuery innerJoinStationPodcast($relationAlias = null) Adds a INNER JOIN clause to the query using the StationPodcast relation
@ -58,6 +52,10 @@
* @method PodcastQuery rightJoinImportedPodcast($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ImportedPodcast relation
* @method PodcastQuery innerJoinImportedPodcast($relationAlias = null) Adds a INNER JOIN clause to the query using the ImportedPodcast relation
*
* @method PodcastQuery leftJoinPodcastEpisodes($relationAlias = null) Adds a LEFT JOIN clause to the query using the PodcastEpisodes relation
* @method PodcastQuery rightJoinPodcastEpisodes($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PodcastEpisodes 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 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
*
@ -74,7 +72,6 @@
* @method Podcast findOneByDbItunesCategory(string $itunes_category) Return the first Podcast filtered by the itunes_category column
* @method Podcast findOneByDbItunesExplicit(string $itunes_explicit) Return the first Podcast filtered by the itunes_explicit column
* @method Podcast findOneByDbOwner(int $owner) Return the first Podcast filtered by the owner column
* @method Podcast findOneByDescendantClass(string $descendant_class) Return the first Podcast filtered by the descendant_class column
*
* @method array findByDbId(int $id) Return Podcast objects filtered by the id column
* @method array findByDbTitle(string $title) Return Podcast objects filtered by the title column
@ -90,7 +87,6 @@
* @method array findByDbItunesCategory(string $itunes_category) Return Podcast objects filtered by the itunes_category column
* @method array findByDbItunesExplicit(string $itunes_explicit) Return Podcast objects filtered by the itunes_explicit column
* @method array findByDbOwner(int $owner) Return Podcast objects filtered by the owner column
* @method array findByDescendantClass(string $descendant_class) Return Podcast objects filtered by the descendant_class column
*
* @package propel.generator.airtime.om
*/
@ -198,7 +194,7 @@ abstract class BasePodcastQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT "id", "title", "creator", "description", "language", "copyright", "link", "itunes_author", "itunes_keywords", "itunes_summary", "itunes_subtitle", "itunes_category", "itunes_explicit", "owner", "descendant_class" FROM "podcast" WHERE "id" = :p0';
$sql = 'SELECT "id", "title", "creator", "description", "language", "copyright", "link", "itunes_author", "itunes_keywords", "itunes_summary", "itunes_subtitle", "itunes_category", "itunes_explicit", "owner" FROM "podcast" WHERE "id" = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@ -721,35 +717,6 @@ abstract class BasePodcastQuery extends ModelCriteria
return $this->addUsingAlias(PodcastPeer::OWNER, $dbOwner, $comparison);
}
/**
* Filter the query on the descendant_class column
*
* Example usage:
* <code>
* $query->filterByDescendantClass('fooValue'); // WHERE descendant_class = 'fooValue'
* $query->filterByDescendantClass('%fooValue%'); // WHERE descendant_class LIKE '%fooValue%'
* </code>
*
* @param string $descendantClass 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 PodcastQuery The current query, for fluid interface
*/
public function filterByDescendantClass($descendantClass = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($descendantClass)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $descendantClass)) {
$descendantClass = str_replace('*', '%', $descendantClass);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PodcastPeer::DESCENDANT_CLASS, $descendantClass, $comparison);
}
/**
* Filter the query by a related CcSubjs object
*
@ -826,6 +793,154 @@ abstract class BasePodcastQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery');
}
/**
* Filter the query by a related StationPodcast object
*
* @param StationPodcast|PropelObjectCollection $stationPodcast the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return PodcastQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByStationPodcast($stationPodcast, $comparison = null)
{
if ($stationPodcast instanceof StationPodcast) {
return $this
->addUsingAlias(PodcastPeer::ID, $stationPodcast->getDbPodcastId(), $comparison);
} elseif ($stationPodcast instanceof PropelObjectCollection) {
return $this
->useStationPodcastQuery()
->filterByPrimaryKeys($stationPodcast->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByStationPodcast() only accepts arguments of type StationPodcast or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the StationPodcast relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return PodcastQuery The current query, for fluid interface
*/
public function joinStationPodcast($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('StationPodcast');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'StationPodcast');
}
return $this;
}
/**
* Use the StationPodcast relation StationPodcast object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return StationPodcastQuery A secondary query class using the current class as primary query
*/
public function useStationPodcastQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinStationPodcast($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'StationPodcast', 'StationPodcastQuery');
}
/**
* Filter the query by a related ImportedPodcast object
*
* @param ImportedPodcast|PropelObjectCollection $importedPodcast the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return PodcastQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByImportedPodcast($importedPodcast, $comparison = null)
{
if ($importedPodcast instanceof ImportedPodcast) {
return $this
->addUsingAlias(PodcastPeer::ID, $importedPodcast->getDbPodcastId(), $comparison);
} elseif ($importedPodcast instanceof PropelObjectCollection) {
return $this
->useImportedPodcastQuery()
->filterByPrimaryKeys($importedPodcast->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByImportedPodcast() only accepts arguments of type ImportedPodcast or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the ImportedPodcast relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return PodcastQuery The current query, for fluid interface
*/
public function joinImportedPodcast($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ImportedPodcast');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'ImportedPodcast');
}
return $this;
}
/**
* Use the ImportedPodcast relation ImportedPodcast object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ImportedPodcastQuery A secondary query class using the current class as primary query
*/
public function useImportedPodcastQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinImportedPodcast($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ImportedPodcast', 'ImportedPodcastQuery');
}
/**
* Filter the query by a related PodcastEpisodes object
*
@ -900,154 +1015,6 @@ abstract class BasePodcastQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'PodcastEpisodes', 'PodcastEpisodesQuery');
}
/**
* Filter the query by a related StationPodcast object
*
* @param StationPodcast|PropelObjectCollection $stationPodcast the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return PodcastQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByStationPodcast($stationPodcast, $comparison = null)
{
if ($stationPodcast instanceof StationPodcast) {
return $this
->addUsingAlias(PodcastPeer::ID, $stationPodcast->getDbId(), $comparison);
} elseif ($stationPodcast instanceof PropelObjectCollection) {
return $this
->useStationPodcastQuery()
->filterByPrimaryKeys($stationPodcast->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByStationPodcast() only accepts arguments of type StationPodcast or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the StationPodcast relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return PodcastQuery The current query, for fluid interface
*/
public function joinStationPodcast($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('StationPodcast');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'StationPodcast');
}
return $this;
}
/**
* Use the StationPodcast relation StationPodcast object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return StationPodcastQuery A secondary query class using the current class as primary query
*/
public function useStationPodcastQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinStationPodcast($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'StationPodcast', 'StationPodcastQuery');
}
/**
* Filter the query by a related ImportedPodcast object
*
* @param ImportedPodcast|PropelObjectCollection $importedPodcast the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return PodcastQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByImportedPodcast($importedPodcast, $comparison = null)
{
if ($importedPodcast instanceof ImportedPodcast) {
return $this
->addUsingAlias(PodcastPeer::ID, $importedPodcast->getDbId(), $comparison);
} elseif ($importedPodcast instanceof PropelObjectCollection) {
return $this
->useImportedPodcastQuery()
->filterByPrimaryKeys($importedPodcast->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByImportedPodcast() only accepts arguments of type ImportedPodcast or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the ImportedPodcast relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return PodcastQuery The current query, for fluid interface
*/
public function joinImportedPodcast($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ImportedPodcast');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'ImportedPodcast');
}
return $this;
}
/**
* Use the ImportedPodcast relation ImportedPodcast object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ImportedPodcastQuery A secondary query class using the current class as primary query
*/
public function useImportedPodcastQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinImportedPodcast($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ImportedPodcast', 'ImportedPodcastQuery');
}
/**
* Exclude object from result
*

View file

@ -8,7 +8,7 @@
*
* @package propel.generator.airtime.om
*/
abstract class BaseStationPodcastPeer extends PodcastPeer
abstract class BaseStationPodcastPeer
{
/** the default database name for this class */
@ -24,55 +24,19 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
const TM_CLASS = 'StationPodcastTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 14;
const NUM_COLUMNS = 2;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */
const NUM_HYDRATE_COLUMNS = 14;
const NUM_HYDRATE_COLUMNS = 2;
/** the column name for the id field */
const ID = 'station_podcast.id';
/** the column name for the title field */
const TITLE = 'station_podcast.title';
/** the column name for the creator field */
const CREATOR = 'station_podcast.creator';
/** the column name for the description field */
const DESCRIPTION = 'station_podcast.description';
/** the column name for the language field */
const LANGUAGE = 'station_podcast.language';
/** the column name for the copyright field */
const COPYRIGHT = 'station_podcast.copyright';
/** the column name for the link field */
const LINK = 'station_podcast.link';
/** the column name for the itunes_author field */
const ITUNES_AUTHOR = 'station_podcast.itunes_author';
/** the column name for the itunes_keywords field */
const ITUNES_KEYWORDS = 'station_podcast.itunes_keywords';
/** the column name for the itunes_summary field */
const ITUNES_SUMMARY = 'station_podcast.itunes_summary';
/** the column name for the itunes_subtitle field */
const ITUNES_SUBTITLE = 'station_podcast.itunes_subtitle';
/** the column name for the itunes_category field */
const ITUNES_CATEGORY = 'station_podcast.itunes_category';
/** the column name for the itunes_explicit field */
const ITUNES_EXPLICIT = 'station_podcast.itunes_explicit';
/** the column name for the owner field */
const OWNER = 'station_podcast.owner';
/** the column name for the podcast_id field */
const PODCAST_ID = 'station_podcast.podcast_id';
/** The default string format for model objects of the related table **/
const DEFAULT_STRING_FORMAT = 'YAML';
@ -93,12 +57,12 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
* e.g. StationPodcastPeer::$fieldNames[StationPodcastPeer::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbTitle', 'DbCreator', 'DbDescription', 'DbLanguage', 'DbCopyright', 'DbLink', 'DbItunesAuthor', 'DbItunesKeywords', 'DbItunesSummary', 'DbItunesSubtitle', 'DbItunesCategory', 'DbItunesExplicit', 'DbOwner', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbTitle', 'dbCreator', 'dbDescription', 'dbLanguage', 'dbCopyright', 'dbLink', 'dbItunesAuthor', 'dbItunesKeywords', 'dbItunesSummary', 'dbItunesSubtitle', 'dbItunesCategory', 'dbItunesExplicit', 'dbOwner', ),
BasePeer::TYPE_COLNAME => array (StationPodcastPeer::ID, StationPodcastPeer::TITLE, StationPodcastPeer::CREATOR, StationPodcastPeer::DESCRIPTION, StationPodcastPeer::LANGUAGE, StationPodcastPeer::COPYRIGHT, StationPodcastPeer::LINK, StationPodcastPeer::ITUNES_AUTHOR, StationPodcastPeer::ITUNES_KEYWORDS, StationPodcastPeer::ITUNES_SUMMARY, StationPodcastPeer::ITUNES_SUBTITLE, StationPodcastPeer::ITUNES_CATEGORY, StationPodcastPeer::ITUNES_EXPLICIT, StationPodcastPeer::OWNER, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'TITLE', 'CREATOR', 'DESCRIPTION', 'LANGUAGE', 'COPYRIGHT', 'LINK', 'ITUNES_AUTHOR', 'ITUNES_KEYWORDS', 'ITUNES_SUMMARY', 'ITUNES_SUBTITLE', 'ITUNES_CATEGORY', 'ITUNES_EXPLICIT', 'OWNER', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'title', 'creator', 'description', 'language', 'copyright', 'link', 'itunes_author', 'itunes_keywords', 'itunes_summary', 'itunes_subtitle', 'itunes_category', 'itunes_explicit', 'owner', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbPodcastId', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbPodcastId', ),
BasePeer::TYPE_COLNAME => array (StationPodcastPeer::ID, StationPodcastPeer::PODCAST_ID, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'PODCAST_ID', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'podcast_id', ),
BasePeer::TYPE_NUM => array (0, 1, )
);
/**
@ -108,12 +72,12 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
* e.g. StationPodcastPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbTitle' => 1, 'DbCreator' => 2, 'DbDescription' => 3, 'DbLanguage' => 4, 'DbCopyright' => 5, 'DbLink' => 6, 'DbItunesAuthor' => 7, 'DbItunesKeywords' => 8, 'DbItunesSummary' => 9, 'DbItunesSubtitle' => 10, 'DbItunesCategory' => 11, 'DbItunesExplicit' => 12, 'DbOwner' => 13, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbTitle' => 1, 'dbCreator' => 2, 'dbDescription' => 3, 'dbLanguage' => 4, 'dbCopyright' => 5, 'dbLink' => 6, 'dbItunesAuthor' => 7, 'dbItunesKeywords' => 8, 'dbItunesSummary' => 9, 'dbItunesSubtitle' => 10, 'dbItunesCategory' => 11, 'dbItunesExplicit' => 12, 'dbOwner' => 13, ),
BasePeer::TYPE_COLNAME => array (StationPodcastPeer::ID => 0, StationPodcastPeer::TITLE => 1, StationPodcastPeer::CREATOR => 2, StationPodcastPeer::DESCRIPTION => 3, StationPodcastPeer::LANGUAGE => 4, StationPodcastPeer::COPYRIGHT => 5, StationPodcastPeer::LINK => 6, StationPodcastPeer::ITUNES_AUTHOR => 7, StationPodcastPeer::ITUNES_KEYWORDS => 8, StationPodcastPeer::ITUNES_SUMMARY => 9, StationPodcastPeer::ITUNES_SUBTITLE => 10, StationPodcastPeer::ITUNES_CATEGORY => 11, StationPodcastPeer::ITUNES_EXPLICIT => 12, StationPodcastPeer::OWNER => 13, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'TITLE' => 1, 'CREATOR' => 2, 'DESCRIPTION' => 3, 'LANGUAGE' => 4, 'COPYRIGHT' => 5, 'LINK' => 6, 'ITUNES_AUTHOR' => 7, 'ITUNES_KEYWORDS' => 8, 'ITUNES_SUMMARY' => 9, 'ITUNES_SUBTITLE' => 10, 'ITUNES_CATEGORY' => 11, 'ITUNES_EXPLICIT' => 12, 'OWNER' => 13, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'title' => 1, 'creator' => 2, 'description' => 3, 'language' => 4, 'copyright' => 5, 'link' => 6, 'itunes_author' => 7, 'itunes_keywords' => 8, 'itunes_summary' => 9, 'itunes_subtitle' => 10, 'itunes_category' => 11, 'itunes_explicit' => 12, 'owner' => 13, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbPodcastId' => 1, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbPodcastId' => 1, ),
BasePeer::TYPE_COLNAME => array (StationPodcastPeer::ID => 0, StationPodcastPeer::PODCAST_ID => 1, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'PODCAST_ID' => 1, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'podcast_id' => 1, ),
BasePeer::TYPE_NUM => array (0, 1, )
);
/**
@ -188,34 +152,10 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
{
if (null === $alias) {
$criteria->addSelectColumn(StationPodcastPeer::ID);
$criteria->addSelectColumn(StationPodcastPeer::TITLE);
$criteria->addSelectColumn(StationPodcastPeer::CREATOR);
$criteria->addSelectColumn(StationPodcastPeer::DESCRIPTION);
$criteria->addSelectColumn(StationPodcastPeer::LANGUAGE);
$criteria->addSelectColumn(StationPodcastPeer::COPYRIGHT);
$criteria->addSelectColumn(StationPodcastPeer::LINK);
$criteria->addSelectColumn(StationPodcastPeer::ITUNES_AUTHOR);
$criteria->addSelectColumn(StationPodcastPeer::ITUNES_KEYWORDS);
$criteria->addSelectColumn(StationPodcastPeer::ITUNES_SUMMARY);
$criteria->addSelectColumn(StationPodcastPeer::ITUNES_SUBTITLE);
$criteria->addSelectColumn(StationPodcastPeer::ITUNES_CATEGORY);
$criteria->addSelectColumn(StationPodcastPeer::ITUNES_EXPLICIT);
$criteria->addSelectColumn(StationPodcastPeer::OWNER);
$criteria->addSelectColumn(StationPodcastPeer::PODCAST_ID);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.title');
$criteria->addSelectColumn($alias . '.creator');
$criteria->addSelectColumn($alias . '.description');
$criteria->addSelectColumn($alias . '.language');
$criteria->addSelectColumn($alias . '.copyright');
$criteria->addSelectColumn($alias . '.link');
$criteria->addSelectColumn($alias . '.itunes_author');
$criteria->addSelectColumn($alias . '.itunes_keywords');
$criteria->addSelectColumn($alias . '.itunes_summary');
$criteria->addSelectColumn($alias . '.itunes_subtitle');
$criteria->addSelectColumn($alias . '.itunes_category');
$criteria->addSelectColumn($alias . '.itunes_explicit');
$criteria->addSelectColumn($alias . '.owner');
$criteria->addSelectColumn($alias . '.podcast_id');
}
}
@ -553,58 +493,7 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
$con = Propel::getConnection(StationPodcastPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(StationPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Returns the number of rows matching criteria, joining the related CcSubjs table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinCcSubjs(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(StationPodcastPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
StationPodcastPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(StationPodcastPeer::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(StationPodcastPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(StationPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$criteria->addJoin(StationPodcastPeer::PODCAST_ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
@ -641,7 +530,7 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
$startcol = StationPodcastPeer::NUM_HYDRATE_COLUMNS;
PodcastPeer::addSelectColumns($criteria);
$criteria->addJoin(StationPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$criteria->addJoin(StationPodcastPeer::PODCAST_ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
@ -674,74 +563,6 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
} // if obj2 already loaded
// Add the $obj1 (StationPodcast) to $obj2 (Podcast)
// one to one relationship
$obj1->setPodcast($obj2);
} // if joined row was not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Selects a collection of StationPodcast objects pre-filled with their CcSubjs objects.
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of StationPodcast objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(StationPodcastPeer::DATABASE_NAME);
}
StationPodcastPeer::addSelectColumns($criteria);
$startcol = StationPodcastPeer::NUM_HYDRATE_COLUMNS;
CcSubjsPeer::addSelectColumns($criteria);
$criteria->addJoin(StationPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = StationPodcastPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = StationPodcastPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = StationPodcastPeer::getOMClass();
$obj1 = new $cls();
$obj1->hydrate($row);
StationPodcastPeer::addInstanceToPool($obj1, $key1);
} // if $obj1 already loaded
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass();
$obj2 = new $cls();
$obj2->hydrate($row, $startcol);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if obj2 already loaded
// Add the $obj1 (StationPodcast) to $obj2 (CcSubjs)
$obj2->addStationPodcast($obj1);
} // if joined row was not null
@ -790,9 +611,7 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
$con = Propel::getConnection(StationPodcastPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(StationPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$criteria->addJoin(StationPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$criteria->addJoin(StationPodcastPeer::PODCAST_ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
@ -831,12 +650,7 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
PodcastPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + PodcastPeer::NUM_HYDRATE_COLUMNS;
CcSubjsPeer::addSelectColumns($criteria);
$startcol4 = $startcol3 + CcSubjsPeer::NUM_HYDRATE_COLUMNS;
$criteria->addJoin(StationPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$criteria->addJoin(StationPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$criteria->addJoin(StationPodcastPeer::PODCAST_ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
@ -870,276 +684,8 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
} // if obj2 loaded
// Add the $obj1 (StationPodcast) to the collection in $obj2 (Podcast)
$obj1->setPodcast($obj2);
} // if joined row not null
// Add objects for joined CcSubjs rows
$key3 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol3);
if ($key3 !== null) {
$obj3 = CcSubjsPeer::getInstanceFromPool($key3);
if (!$obj3) {
$cls = CcSubjsPeer::getOMClass();
$obj3 = new $cls();
$obj3->hydrate($row, $startcol3);
CcSubjsPeer::addInstanceToPool($obj3, $key3);
} // if obj3 loaded
// Add the $obj1 (StationPodcast) to the collection in $obj3 (CcSubjs)
$obj3->addStationPodcast($obj1);
} // if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining the related Podcast table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinAllExceptPodcast(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(StationPodcastPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
StationPodcastPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY should not affect count
// Set the correct dbName
$criteria->setDbName(StationPodcastPeer::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(StationPodcastPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(StationPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Returns the number of rows matching criteria, joining the related CcSubjs table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinAllExceptCcSubjs(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(StationPodcastPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
StationPodcastPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY should not affect count
// Set the correct dbName
$criteria->setDbName(StationPodcastPeer::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(StationPodcastPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(StationPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of StationPodcast objects pre-filled with all related objects except Podcast.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of StationPodcast objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAllExceptPodcast(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
// $criteria->getDbName() will return the same object if not set to another value
// so == check is okay and faster
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(StationPodcastPeer::DATABASE_NAME);
}
StationPodcastPeer::addSelectColumns($criteria);
$startcol2 = StationPodcastPeer::NUM_HYDRATE_COLUMNS;
CcSubjsPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + CcSubjsPeer::NUM_HYDRATE_COLUMNS;
$criteria->addJoin(StationPodcastPeer::OWNER, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = StationPodcastPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = StationPodcastPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = StationPodcastPeer::getOMClass();
$obj1 = new $cls();
$obj1->hydrate($row);
StationPodcastPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined CcSubjs rows
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass();
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if $obj2 already loaded
// Add the $obj1 (StationPodcast) to the collection in $obj2 (CcSubjs)
$obj2->addStationPodcast($obj1);
} // if joined row is not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Selects a collection of StationPodcast objects pre-filled with all related objects except CcSubjs.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of StationPodcast objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAllExceptCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
// $criteria->getDbName() will return the same object if not set to another value
// so == check is okay and faster
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(StationPodcastPeer::DATABASE_NAME);
}
StationPodcastPeer::addSelectColumns($criteria);
$startcol2 = StationPodcastPeer::NUM_HYDRATE_COLUMNS;
PodcastPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + PodcastPeer::NUM_HYDRATE_COLUMNS;
$criteria->addJoin(StationPodcastPeer::ID, PodcastPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = StationPodcastPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = StationPodcastPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = StationPodcastPeer::getOMClass();
$obj1 = new $cls();
$obj1->hydrate($row);
StationPodcastPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined Podcast rows
$key2 = PodcastPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = PodcastPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = PodcastPeer::getOMClass();
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
PodcastPeer::addInstanceToPool($obj2, $key2);
} // if $obj2 already loaded
// Add the $obj1 (StationPodcast) to the collection in $obj2 (Podcast)
$obj1->setPodcast($obj2);
} // if joined row is not null
} // if joined row not null
$results[] = $obj1;
}
@ -1203,6 +749,10 @@ abstract class BaseStationPodcastPeer extends PodcastPeer
$criteria = $values->buildCriteria(); // build Criteria from StationPodcast object
}
if ($criteria->containsKey(StationPodcastPeer::ID) && $criteria->keyContainsValue(StationPodcastPeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.StationPodcastPeer::ID.')');
}
// Set the correct dbName
$criteria->setDbName(StationPodcastPeer::DATABASE_NAME);

View file

@ -7,34 +7,10 @@
*
*
* @method StationPodcastQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method StationPodcastQuery orderByDbTitle($order = Criteria::ASC) Order by the title column
* @method StationPodcastQuery orderByDbCreator($order = Criteria::ASC) Order by the creator column
* @method StationPodcastQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
* @method StationPodcastQuery orderByDbLanguage($order = Criteria::ASC) Order by the language column
* @method StationPodcastQuery orderByDbCopyright($order = Criteria::ASC) Order by the copyright column
* @method StationPodcastQuery orderByDbLink($order = Criteria::ASC) Order by the link column
* @method StationPodcastQuery orderByDbItunesAuthor($order = Criteria::ASC) Order by the itunes_author column
* @method StationPodcastQuery orderByDbItunesKeywords($order = Criteria::ASC) Order by the itunes_keywords column
* @method StationPodcastQuery orderByDbItunesSummary($order = Criteria::ASC) Order by the itunes_summary column
* @method StationPodcastQuery orderByDbItunesSubtitle($order = Criteria::ASC) Order by the itunes_subtitle column
* @method StationPodcastQuery orderByDbItunesCategory($order = Criteria::ASC) Order by the itunes_category column
* @method StationPodcastQuery orderByDbItunesExplicit($order = Criteria::ASC) Order by the itunes_explicit column
* @method StationPodcastQuery orderByDbOwner($order = Criteria::ASC) Order by the owner column
* @method StationPodcastQuery orderByDbPodcastId($order = Criteria::ASC) Order by the podcast_id column
*
* @method StationPodcastQuery groupByDbId() Group by the id column
* @method StationPodcastQuery groupByDbTitle() Group by the title column
* @method StationPodcastQuery groupByDbCreator() Group by the creator column
* @method StationPodcastQuery groupByDbDescription() Group by the description column
* @method StationPodcastQuery groupByDbLanguage() Group by the language column
* @method StationPodcastQuery groupByDbCopyright() Group by the copyright column
* @method StationPodcastQuery groupByDbLink() Group by the link column
* @method StationPodcastQuery groupByDbItunesAuthor() Group by the itunes_author column
* @method StationPodcastQuery groupByDbItunesKeywords() Group by the itunes_keywords column
* @method StationPodcastQuery groupByDbItunesSummary() Group by the itunes_summary column
* @method StationPodcastQuery groupByDbItunesSubtitle() Group by the itunes_subtitle column
* @method StationPodcastQuery groupByDbItunesCategory() Group by the itunes_category column
* @method StationPodcastQuery groupByDbItunesExplicit() Group by the itunes_explicit column
* @method StationPodcastQuery groupByDbOwner() Group by the owner column
* @method StationPodcastQuery groupByDbPodcastId() Group by the podcast_id column
*
* @method StationPodcastQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method StationPodcastQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -44,45 +20,17 @@
* @method StationPodcastQuery rightJoinPodcast($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Podcast relation
* @method StationPodcastQuery innerJoinPodcast($relationAlias = null) Adds a INNER JOIN clause to the query using the Podcast relation
*
* @method StationPodcastQuery leftJoinCcSubjs($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcSubjs relation
* @method StationPodcastQuery rightJoinCcSubjs($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcSubjs relation
* @method StationPodcastQuery innerJoinCcSubjs($relationAlias = null) Adds a INNER JOIN clause to the query using the CcSubjs relation
*
* @method StationPodcast findOne(PropelPDO $con = null) Return the first StationPodcast matching the query
* @method StationPodcast findOneOrCreate(PropelPDO $con = null) Return the first StationPodcast matching the query, or a new StationPodcast object populated from the query conditions when no match is found
*
* @method StationPodcast findOneByDbTitle(string $title) Return the first StationPodcast filtered by the title column
* @method StationPodcast findOneByDbCreator(string $creator) Return the first StationPodcast filtered by the creator column
* @method StationPodcast findOneByDbDescription(string $description) Return the first StationPodcast filtered by the description column
* @method StationPodcast findOneByDbLanguage(string $language) Return the first StationPodcast filtered by the language column
* @method StationPodcast findOneByDbCopyright(string $copyright) Return the first StationPodcast filtered by the copyright column
* @method StationPodcast findOneByDbLink(string $link) Return the first StationPodcast filtered by the link column
* @method StationPodcast findOneByDbItunesAuthor(string $itunes_author) Return the first StationPodcast filtered by the itunes_author column
* @method StationPodcast findOneByDbItunesKeywords(string $itunes_keywords) Return the first StationPodcast filtered by the itunes_keywords column
* @method StationPodcast findOneByDbItunesSummary(string $itunes_summary) Return the first StationPodcast filtered by the itunes_summary column
* @method StationPodcast findOneByDbItunesSubtitle(string $itunes_subtitle) Return the first StationPodcast filtered by the itunes_subtitle column
* @method StationPodcast findOneByDbItunesCategory(string $itunes_category) Return the first StationPodcast filtered by the itunes_category column
* @method StationPodcast findOneByDbItunesExplicit(string $itunes_explicit) Return the first StationPodcast filtered by the itunes_explicit column
* @method StationPodcast findOneByDbOwner(int $owner) Return the first StationPodcast filtered by the owner column
* @method StationPodcast findOneByDbPodcastId(int $podcast_id) Return the first StationPodcast filtered by the podcast_id column
*
* @method array findByDbId(int $id) Return StationPodcast objects filtered by the id column
* @method array findByDbTitle(string $title) Return StationPodcast objects filtered by the title column
* @method array findByDbCreator(string $creator) Return StationPodcast objects filtered by the creator column
* @method array findByDbDescription(string $description) Return StationPodcast objects filtered by the description column
* @method array findByDbLanguage(string $language) Return StationPodcast objects filtered by the language column
* @method array findByDbCopyright(string $copyright) Return StationPodcast objects filtered by the copyright column
* @method array findByDbLink(string $link) Return StationPodcast objects filtered by the link column
* @method array findByDbItunesAuthor(string $itunes_author) Return StationPodcast objects filtered by the itunes_author column
* @method array findByDbItunesKeywords(string $itunes_keywords) Return StationPodcast objects filtered by the itunes_keywords column
* @method array findByDbItunesSummary(string $itunes_summary) Return StationPodcast objects filtered by the itunes_summary column
* @method array findByDbItunesSubtitle(string $itunes_subtitle) Return StationPodcast objects filtered by the itunes_subtitle column
* @method array findByDbItunesCategory(string $itunes_category) Return StationPodcast objects filtered by the itunes_category column
* @method array findByDbItunesExplicit(string $itunes_explicit) Return StationPodcast objects filtered by the itunes_explicit column
* @method array findByDbOwner(int $owner) Return StationPodcast objects filtered by the owner column
* @method array findByDbPodcastId(int $podcast_id) Return StationPodcast objects filtered by the podcast_id column
*
* @package propel.generator.airtime.om
*/
abstract class BaseStationPodcastQuery extends PodcastQuery
abstract class BaseStationPodcastQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseStationPodcastQuery object.
@ -186,7 +134,7 @@ abstract class BaseStationPodcastQuery extends PodcastQuery
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT "id", "title", "creator", "description", "language", "copyright", "link", "itunes_author", "itunes_keywords", "itunes_summary", "itunes_subtitle", "itunes_category", "itunes_explicit", "owner" FROM "station_podcast" WHERE "id" = :p0';
$sql = 'SELECT "id", "podcast_id" FROM "station_podcast" WHERE "id" = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@ -286,8 +234,6 @@ abstract class BaseStationPodcastQuery extends PodcastQuery
* $query->filterByDbId(array('max' => 12)); // WHERE id <= 12
* </code>
*
* @see filterByPodcast()
*
* @param mixed $dbId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
@ -320,367 +266,19 @@ abstract class BaseStationPodcastQuery extends PodcastQuery
}
/**
* Filter the query on the title column
* Filter the query on the podcast_id column
*
* Example usage:
* <code>
* $query->filterByDbTitle('fooValue'); // WHERE title = 'fooValue'
* $query->filterByDbTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
* $query->filterByDbPodcastId(1234); // WHERE podcast_id = 1234
* $query->filterByDbPodcastId(array(12, 34)); // WHERE podcast_id IN (12, 34)
* $query->filterByDbPodcastId(array('min' => 12)); // WHERE podcast_id >= 12
* $query->filterByDbPodcastId(array('max' => 12)); // WHERE podcast_id <= 12
* </code>
*
* @param string $dbTitle 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
* @see filterByPodcast()
*
* @return StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbTitle($dbTitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbTitle)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbTitle)) {
$dbTitle = str_replace('*', '%', $dbTitle);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::TITLE, $dbTitle, $comparison);
}
/**
* Filter the query on the creator column
*
* Example usage:
* <code>
* $query->filterByDbCreator('fooValue'); // WHERE creator = 'fooValue'
* $query->filterByDbCreator('%fooValue%'); // WHERE creator LIKE '%fooValue%'
* </code>
*
* @param string $dbCreator 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbCreator($dbCreator = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbCreator)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbCreator)) {
$dbCreator = str_replace('*', '%', $dbCreator);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::CREATOR, $dbCreator, $comparison);
}
/**
* Filter the query on the description column
*
* Example usage:
* <code>
* $query->filterByDbDescription('fooValue'); // WHERE description = 'fooValue'
* $query->filterByDbDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
* </code>
*
* @param string $dbDescription 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbDescription($dbDescription = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbDescription)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbDescription)) {
$dbDescription = str_replace('*', '%', $dbDescription);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::DESCRIPTION, $dbDescription, $comparison);
}
/**
* Filter the query on the language column
*
* Example usage:
* <code>
* $query->filterByDbLanguage('fooValue'); // WHERE language = 'fooValue'
* $query->filterByDbLanguage('%fooValue%'); // WHERE language LIKE '%fooValue%'
* </code>
*
* @param string $dbLanguage 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbLanguage($dbLanguage = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbLanguage)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbLanguage)) {
$dbLanguage = str_replace('*', '%', $dbLanguage);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::LANGUAGE, $dbLanguage, $comparison);
}
/**
* Filter the query on the copyright column
*
* Example usage:
* <code>
* $query->filterByDbCopyright('fooValue'); // WHERE copyright = 'fooValue'
* $query->filterByDbCopyright('%fooValue%'); // WHERE copyright LIKE '%fooValue%'
* </code>
*
* @param string $dbCopyright 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbCopyright($dbCopyright = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbCopyright)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbCopyright)) {
$dbCopyright = str_replace('*', '%', $dbCopyright);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::COPYRIGHT, $dbCopyright, $comparison);
}
/**
* Filter the query on the link column
*
* Example usage:
* <code>
* $query->filterByDbLink('fooValue'); // WHERE link = 'fooValue'
* $query->filterByDbLink('%fooValue%'); // WHERE link LIKE '%fooValue%'
* </code>
*
* @param string $dbLink 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbLink($dbLink = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbLink)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbLink)) {
$dbLink = str_replace('*', '%', $dbLink);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::LINK, $dbLink, $comparison);
}
/**
* Filter the query on the itunes_author column
*
* Example usage:
* <code>
* $query->filterByDbItunesAuthor('fooValue'); // WHERE itunes_author = 'fooValue'
* $query->filterByDbItunesAuthor('%fooValue%'); // WHERE itunes_author LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesAuthor 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesAuthor($dbItunesAuthor = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesAuthor)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesAuthor)) {
$dbItunesAuthor = str_replace('*', '%', $dbItunesAuthor);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::ITUNES_AUTHOR, $dbItunesAuthor, $comparison);
}
/**
* Filter the query on the itunes_keywords column
*
* Example usage:
* <code>
* $query->filterByDbItunesKeywords('fooValue'); // WHERE itunes_keywords = 'fooValue'
* $query->filterByDbItunesKeywords('%fooValue%'); // WHERE itunes_keywords LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesKeywords 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesKeywords($dbItunesKeywords = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesKeywords)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesKeywords)) {
$dbItunesKeywords = str_replace('*', '%', $dbItunesKeywords);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::ITUNES_KEYWORDS, $dbItunesKeywords, $comparison);
}
/**
* Filter the query on the itunes_summary column
*
* Example usage:
* <code>
* $query->filterByDbItunesSummary('fooValue'); // WHERE itunes_summary = 'fooValue'
* $query->filterByDbItunesSummary('%fooValue%'); // WHERE itunes_summary LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesSummary 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesSummary($dbItunesSummary = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesSummary)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesSummary)) {
$dbItunesSummary = str_replace('*', '%', $dbItunesSummary);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::ITUNES_SUMMARY, $dbItunesSummary, $comparison);
}
/**
* Filter the query on the itunes_subtitle column
*
* Example usage:
* <code>
* $query->filterByDbItunesSubtitle('fooValue'); // WHERE itunes_subtitle = 'fooValue'
* $query->filterByDbItunesSubtitle('%fooValue%'); // WHERE itunes_subtitle LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesSubtitle 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesSubtitle($dbItunesSubtitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesSubtitle)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesSubtitle)) {
$dbItunesSubtitle = str_replace('*', '%', $dbItunesSubtitle);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::ITUNES_SUBTITLE, $dbItunesSubtitle, $comparison);
}
/**
* Filter the query on the itunes_category column
*
* Example usage:
* <code>
* $query->filterByDbItunesCategory('fooValue'); // WHERE itunes_category = 'fooValue'
* $query->filterByDbItunesCategory('%fooValue%'); // WHERE itunes_category LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesCategory 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesCategory($dbItunesCategory = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesCategory)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesCategory)) {
$dbItunesCategory = str_replace('*', '%', $dbItunesCategory);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::ITUNES_CATEGORY, $dbItunesCategory, $comparison);
}
/**
* Filter the query on the itunes_explicit column
*
* Example usage:
* <code>
* $query->filterByDbItunesExplicit('fooValue'); // WHERE itunes_explicit = 'fooValue'
* $query->filterByDbItunesExplicit('%fooValue%'); // WHERE itunes_explicit LIKE '%fooValue%'
* </code>
*
* @param string $dbItunesExplicit 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 StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbItunesExplicit($dbItunesExplicit = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbItunesExplicit)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbItunesExplicit)) {
$dbItunesExplicit = str_replace('*', '%', $dbItunesExplicit);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(StationPodcastPeer::ITUNES_EXPLICIT, $dbItunesExplicit, $comparison);
}
/**
* Filter the query on the owner column
*
* Example usage:
* <code>
* $query->filterByDbOwner(1234); // WHERE owner = 1234
* $query->filterByDbOwner(array(12, 34)); // WHERE owner IN (12, 34)
* $query->filterByDbOwner(array('min' => 12)); // WHERE owner >= 12
* $query->filterByDbOwner(array('max' => 12)); // WHERE owner <= 12
* </code>
*
* @see filterByCcSubjs()
*
* @param mixed $dbOwner The value to use as filter.
* @param mixed $dbPodcastId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@ -688,16 +286,16 @@ abstract class BaseStationPodcastQuery extends PodcastQuery
*
* @return StationPodcastQuery The current query, for fluid interface
*/
public function filterByDbOwner($dbOwner = null, $comparison = null)
public function filterByDbPodcastId($dbPodcastId = null, $comparison = null)
{
if (is_array($dbOwner)) {
if (is_array($dbPodcastId)) {
$useMinMax = false;
if (isset($dbOwner['min'])) {
$this->addUsingAlias(StationPodcastPeer::OWNER, $dbOwner['min'], Criteria::GREATER_EQUAL);
if (isset($dbPodcastId['min'])) {
$this->addUsingAlias(StationPodcastPeer::PODCAST_ID, $dbPodcastId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbOwner['max'])) {
$this->addUsingAlias(StationPodcastPeer::OWNER, $dbOwner['max'], Criteria::LESS_EQUAL);
if (isset($dbPodcastId['max'])) {
$this->addUsingAlias(StationPodcastPeer::PODCAST_ID, $dbPodcastId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@ -708,7 +306,7 @@ abstract class BaseStationPodcastQuery extends PodcastQuery
}
}
return $this->addUsingAlias(StationPodcastPeer::OWNER, $dbOwner, $comparison);
return $this->addUsingAlias(StationPodcastPeer::PODCAST_ID, $dbPodcastId, $comparison);
}
/**
@ -724,14 +322,14 @@ abstract class BaseStationPodcastQuery extends PodcastQuery
{
if ($podcast instanceof Podcast) {
return $this
->addUsingAlias(StationPodcastPeer::ID, $podcast->getDbId(), $comparison);
->addUsingAlias(StationPodcastPeer::PODCAST_ID, $podcast->getDbId(), $comparison);
} elseif ($podcast instanceof PropelObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(StationPodcastPeer::ID, $podcast->toKeyValue('PrimaryKey', 'DbId'), $comparison);
->addUsingAlias(StationPodcastPeer::PODCAST_ID, $podcast->toKeyValue('PrimaryKey', 'DbId'), $comparison);
} else {
throw new PropelException('filterByPodcast() only accepts arguments of type Podcast or PropelCollection');
}
@ -787,82 +385,6 @@ abstract class BaseStationPodcastQuery extends PodcastQuery
->useQuery($relationAlias ? $relationAlias : 'Podcast', 'PodcastQuery');
}
/**
* Filter the query by a related CcSubjs object
*
* @param CcSubjs|PropelObjectCollection $ccSubjs The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return StationPodcastQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
if ($ccSubjs instanceof CcSubjs) {
return $this
->addUsingAlias(StationPodcastPeer::OWNER, $ccSubjs->getDbId(), $comparison);
} elseif ($ccSubjs instanceof PropelObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(StationPodcastPeer::OWNER, $ccSubjs->toKeyValue('PrimaryKey', 'DbId'), $comparison);
} else {
throw new PropelException('filterByCcSubjs() only accepts arguments of type CcSubjs or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the CcSubjs relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return StationPodcastQuery The current query, for fluid interface
*/
public function joinCcSubjs($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcSubjs');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CcSubjs');
}
return $this;
}
/**
* Use the CcSubjs relation CcSubjs object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcSubjsQuery A secondary query class using the current class as primary query
*/
public function useCcSubjsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcSubjs($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery');
}
/**
* Exclude object from result
*

View file

@ -1,5 +1,7 @@
<?php
require_once('PodcastFactory.php');
class Rest_PodcastController extends Zend_Rest_Controller
{
@ -15,7 +17,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
// Remove reliance on .phtml files to render requests
$this->_helper->viewRenderer->setNoRender(true);
$this->view->setScriptPath(APPLICATION_PATH . 'views/scripts/');
$this->_service = new Application_Service_PodcastService();
$this->_service = new Application_Service_PodcastEpisodeService();
}
public function indexAction()
@ -83,7 +85,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
try {
//$requestData = json_decode($this->getRequest()->getRawBody(), true);
$requestData = $this->getRequest()->getPost();
$podcast = Podcast::create($requestData);
$podcast = PodcastFactory::create($requestData["url"]);
$path = 'podcast/podcast.phtml';
$this->view->podcast = $podcast;
@ -94,10 +96,6 @@ class Rest_PodcastController extends Zend_Rest_Controller
"id"=>$podcast["id"]
// "id"=>$podcast->getDbId()
));
// $this->getResponse()
// ->setHttpResponseCode(201)
// ->appendBody(json_encode($podcast));
}
catch (PodcastLimitReachedException $e) {
$this->getResponse()

View file

@ -14,7 +14,7 @@ class CeleryServiceFactory {
case SOUNDCLOUD_SERVICE_NAME:
return new Application_Service_SoundcloudService();
case PODCAST_SERVICE_NAME:
return new Application_Service_PodcastService();
return new Application_Service_PodcastEpisodeService();
default:
return null;
}

View file

@ -0,0 +1,215 @@
<?php
class PodcastLimitReachedException extends Exception {}
class InvalidPodcastException extends Exception {}
class PodcastNotFoundException extends Exception {}
class Application_Service_ImportedPodcastService
{
// These fields should never be modified with POST/PUT data
private static $privateFields = array(
"id",
"url",
"type",
"owner"
);
/**
* There is maximum of 50 podcasts allowed in the library - to limit
* resource consumption. This function returns true if the podcast
* limit has been reached.
*
* @return bool
*/
public static function importedPodcastLimitReached()
{
if (ImportedPodcastQuery::create()->count() >= 50) {
return true;
} else {
return false;
}
}
/**
* Returns parsed rss feed, or false if the given URL cannot be downloaded
*
* @param $podcastUrl String containing the podcast feed URL
*
* @return mixed
*/
public static function getPodcastFeed($feedUrl)
{
try {
$feed = new SimplePie();
$feed->set_feed_url($feedUrl);
$feed->enable_cache(false);
$feed->init();
return $feed;
} catch (Exception $e) {
return false;
}
}
/** Creates a Podcast object from the given podcast URL.
* This is used by our Podcast REST API
*
* @param $feedUrl Podcast RSS Feed Url
*
* @return array - Podcast Array with a full list of episodes
* @throws Exception
* @throws InvalidPodcastException
* @throws PodcastLimitReachedException
*/
public static function createFromFeedUrl($feedUrl)
{
if (self::importedPodcastLimitReached()) {
throw new PodcastLimitReachedException();
}
//TODO: why is this so slow?
$rss = self::getPodcastFeed($feedUrl);
if (!$rss) {
throw new InvalidPodcastException();
}
// Ensure we are only creating Podcast with the given URL, and excluding
// any extra data fields that may have been POSTED
$podcastArray = array();
$podcastArray["url"] = $feedUrl;
$podcastArray["title"] = $rss->get_title();
$podcastArray["description"] = $rss->get_description();
$podcastArray["link"] = $rss->get_link();
$podcastArray["language"] = $rss->get_language();
$podcastArray["copyright"] = $rss->get_copyright();
$podcastArray["creator"] = $rss->get_author()->get_name();
$podcastArray["category"] = $rss->get_categories();
//TODO: put in constants
$itunesChannel = "http://www.itunes.com/dtds/podcast-1.0.dtd";
$itunesSubtitle = $rss->get_channel_tags($itunesChannel, 'subtitle');
$podcastArray["itunes_subtitle"] = isset($itunesSubtitle[0]["data"]) ? $itunesSubtitle[0]["data"] : "";
$itunesCategory = $rss->get_channel_tags($itunesChannel, 'category');
$categoryArray = array();
foreach ($itunesCategory as $c => $data) {
foreach ($data["attribs"] as $attrib) {
array_push($categoryArray, $attrib["text"]);
}
}
$podcastArray["itunes_category"] = implode(",", $categoryArray);
$itunesAuthor = $rss->get_channel_tags($itunesChannel, 'author');
$podcastArray["itunes_author"] = isset($itunesAuthor[0]["data"]) ? $itunesAuthor[0]["data"] : "";
$itunesSummary = $rss->get_channel_tags($itunesChannel, 'summary');
$podcastArray["itunes_summary"] = isset($itunesSummary[0]["data"]) ? $itunesSummary[0]["data"] : "";
$itunesKeywords = $rss->get_channel_tags($itunesChannel, 'keywords');
$podcastArray["itunes_keywords"] = isset($itunesKeywords[0]["data"]) ? $itunesKeywords[0]["data"] : "";
$itunesExplicit = $rss->get_channel_tags($itunesChannel, 'explicit');
$podcastArray["itunes_explicit"] = isset($itunesExplicit[0]["data"]) ? $itunesExplicit[0]["data"] : "";
self::validatePodcastMetadata($podcastArray);
try {
// Base class
$podcast = new Podcast();
$podcast->fromArray($podcastArray, BasePeer::TYPE_FIELDNAME);
$podcast->setDbOwner(self::getOwnerId());
$podcast->save();
$importedPodcast = new ImportedPodcast();
$importedPodcast->fromArray($podcastArray, BasePeer::TYPE_FIELDNAME);
$importedPodcast->setPodcast($podcast);
$importedPodcast->save();
return self::_generatePodcastArray($importedPodcast, $rss);
} catch(Exception $e) {
$podcast->delete();
throw $e;
}
}
//TODO move this somewhere where it makes sense
private static function getOwnerId()
{
try {
if (Zend_Auth::getInstance()->hasIdentity()) {
$service_user = new Application_Service_UserService();
return $service_user->getCurrentUser()->getDbId();
} else {
$defaultOwner = CcSubjsQuery::create()
->filterByDbType('A')
->orderByDbId()
->findOne();
if (!$defaultOwner) {
// what to do if there is no admin user?
// should we handle this case?
return null;
}
return $defaultOwner->getDbId();
}
} catch(Exception $e) {
Logging::info($e->getMessage());
}
}
/**
* Trims the podcast metadata to fit the table's column max size
*
* @param $podcastArray
*/
private static function validatePodcastMetadata(&$podcastArray)
{
$podcastTable = PodcastPeer::getTableMap();
foreach ($podcastArray as $key => &$value) {
try {
// Make sure column exists in table
$columnMaxSize = $podcastTable->getColumn($key)->getSize();
} catch (PropelException $e) {
continue;
}
if (strlen($value) > $columnMaxSize) {
$value = substr($value, 0, $podcastTable->getColumn($key)->getSize());
}
}
}
/**
* Given a podcast object and a SimplePie feed object,
* generate a data array to pass back to the front-end
*
* @param $importedPodcast ImportedPodcast model object
* @param SimplePie $rss SimplePie feed object
*
* @return array
*/
private static function _generatePodcastArray($importedPodcast, $rss) {
$podcastArray = $importedPodcast->toArray(BasePeer::TYPE_FIELDNAME);
$podcastArray["episodes"] = array();
foreach ($rss->get_items() as $item) {
/** @var SimplePie_Item $item */
array_push($podcastArray["episodes"], array(
"guid" => $item->get_id(),
"title" => $item->get_title(),
"author" => $item->get_author()->get_name(),
"description" => $item->get_description(),
"pub_date" => $item->get_date("Y-m-d H:i:s"),
"link" => $item->get_link(),
"enclosure" => $item->get_enclosure()
));
}
return $podcastArray;
}
}

View file

@ -1,6 +1,6 @@
<?php
class Application_Service_PodcastService extends Application_Service_ThirdPartyCeleryService
class Application_Service_PodcastEpisodeService extends Application_Service_ThirdPartyCeleryService
{
/**
* Arbitrary constant identifiers for the internal tasks array
@ -25,42 +25,6 @@ class Application_Service_PodcastService extends Application_Service_ThirdPartyC
self::DOWNLOAD => 'podcast-download' // TODO: rename this to ingest?
];
/**
* There is maximum of 50 podcasts allowed in the library - to limit
* resource consumption. This function returns true if the podcast
* limit has been reached.
*
* @return bool
*/
public static function podcastLimitReached()
{
if (PodcastQuery::create()->count() >= 50) {
return true;
} else {
return false;
}
}
/**
* Returns parsed rss feed, or false if the given URL cannot be downloaded
*
* @param $podcastUrl String containing the podcast feed URL
*
* @return mixed
*/
public static function getPodcastFeed($podcastUrl)
{
try {
$feed = new SimplePie();
$feed->set_feed_url($podcastUrl);
$feed->enable_cache(false);
$feed->init();
return $feed;
} catch (Exception $e) {
return false;
}
}
public static function createStationRssFeed()
{
//TODO: get station feed podcast ID

View file

@ -0,0 +1,11 @@
<?php
class PodcastFactory
{
public static function create($feedUrl)
{
// check if station podcast exists and if not, create one
return Application_Service_ImportedPodcastService::createFromFeedUrl($feedUrl);
}
}

View file

@ -0,0 +1,6 @@
<?php
class Application_Service_StationPodcastService
{
}

View file

@ -563,7 +563,7 @@
</foreign-key>
</table>
<table name="podcast" phpName="Podcast" abstract="true">
<table name="podcast" phpName="Podcast">
<column name="id" phpName="DbId" primaryKey="true" type="INTEGER" autoIncrement="true" required="true" />
<column name="title" phpName="DbTitle" type="VARCHAR" size="4096" required="true" />
<column name="creator" phpName="DbCreator" type="VARCHAR" size="4096" />
@ -584,16 +584,26 @@
</table>
<table name="station_podcast" phpName="StationPodcast">
<behavior name="concrete_inheritance">
<parameter name="extends" value="podcast" />
<column name="id" phpName="DbId" required="true" primaryKey="true" autoIncrement="true" type="INTEGER"/>
<column name="podcast_id" phpName="DbPodcastId" required="true" type="INTEGER"/>
<foreign-key foreignTable="podcast" name="podcast_id_fkey" onDelete="CASCADE">
<reference local="podcast_id" foreign="id" />
</foreign-key>
<behavior name="delegate">
<parameter name="to" value="podcast" />
</behavior>
</table>
<table name="imported_podcast" phpName="ImportedPodcast">
<column name="id" phpName="DbId" required="true" primaryKey="true" autoIncrement="true" type="INTEGER"/>
<column name="url" phpName="DbUrl" type="VARCHAR" size="4096" required="true" />
<column name="auto_ingest" phpName="DbAutoIngest" type="BOOLEAN" required="true" defaultValue="false"/>
<behavior name="concrete_inheritance">
<parameter name="extends" value="podcast" />
<column name="podcast_id" phpName="DbPodcastId" required="true" type="INTEGER"/>
<foreign-key foreignTable="podcast" name="podcast_id_fkey" onDelete="CASCADE">
<reference local="podcast_id" foreign="id" />
</foreign-key>
<behavior name="delegate">
<parameter name="to" value="podcast" />
</behavior>
</table>

View file

@ -729,7 +729,6 @@ CREATE TABLE "podcast"
"itunes_category" VARCHAR(4096),
"itunes_explicit" VARCHAR(4096),
"owner" INTEGER,
"descendant_class" VARCHAR(100),
PRIMARY KEY ("id")
);
@ -741,20 +740,8 @@ DROP TABLE IF EXISTS "station_podcast" CASCADE;
CREATE TABLE "station_podcast"
(
"id" INTEGER NOT NULL,
"title" VARCHAR(4096) NOT NULL,
"creator" VARCHAR(4096),
"description" VARCHAR(4096),
"language" VARCHAR(4096),
"copyright" VARCHAR(4096),
"link" VARCHAR(4096),
"itunes_author" VARCHAR(4096),
"itunes_keywords" VARCHAR(4096),
"itunes_summary" VARCHAR(4096),
"itunes_subtitle" VARCHAR(4096),
"itunes_category" VARCHAR(4096),
"itunes_explicit" VARCHAR(4096),
"owner" INTEGER,
"id" serial NOT NULL,
"podcast_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
@ -766,22 +753,10 @@ DROP TABLE IF EXISTS "imported_podcast" CASCADE;
CREATE TABLE "imported_podcast"
(
"id" serial NOT NULL,
"url" VARCHAR(4096) NOT NULL,
"auto_ingest" BOOLEAN DEFAULT 'f' NOT NULL,
"id" INTEGER NOT NULL,
"title" VARCHAR(4096) NOT NULL,
"creator" VARCHAR(4096),
"description" VARCHAR(4096),
"language" VARCHAR(4096),
"copyright" VARCHAR(4096),
"link" VARCHAR(4096),
"itunes_author" VARCHAR(4096),
"itunes_keywords" VARCHAR(4096),
"itunes_summary" VARCHAR(4096),
"itunes_subtitle" VARCHAR(4096),
"itunes_category" VARCHAR(4096),
"itunes_explicit" VARCHAR(4096),
"owner" INTEGER,
"podcast_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
@ -979,26 +954,16 @@ ALTER TABLE "podcast" ADD CONSTRAINT "podcast_owner_fkey"
REFERENCES "cc_subjs" ("id")
ON DELETE CASCADE;
ALTER TABLE "station_podcast" ADD CONSTRAINT "station_podcast_FK_1"
FOREIGN KEY ("id")
ALTER TABLE "station_podcast" ADD CONSTRAINT "podcast_id_fkey"
FOREIGN KEY ("podcast_id")
REFERENCES "podcast" ("id")
ON DELETE CASCADE;
ALTER TABLE "station_podcast" ADD CONSTRAINT "station_podcast_FK_2"
FOREIGN KEY ("owner")
REFERENCES "cc_subjs" ("id")
ON DELETE CASCADE;
ALTER TABLE "imported_podcast" ADD CONSTRAINT "imported_podcast_FK_1"
FOREIGN KEY ("id")
ALTER TABLE "imported_podcast" ADD CONSTRAINT "podcast_id_fkey"
FOREIGN KEY ("podcast_id")
REFERENCES "podcast" ("id")
ON DELETE CASCADE;
ALTER TABLE "imported_podcast" ADD CONSTRAINT "imported_podcast_FK_2"
FOREIGN KEY ("owner")
REFERENCES "cc_subjs" ("id")
ON DELETE CASCADE;
ALTER TABLE "podcast_episodes" ADD CONSTRAINT "podcast_episodes_cc_files_fkey"
FOREIGN KEY ("file_id")
REFERENCES "cc_files" ("id")