filterByDbPodcastId($this->getDbId())->findOne(); $stationPodcast = StationPodcastQuery::create()->filterByDbPodcastId($this->getDbId())->findOne(); if (!is_null($importedPodcast)) { $importedPodcastArray = $importedPodcast->toArray($keyType); // unset these values because we already have the podcast id in $podcastArray // and we don't need the imported podcast ID unset($importedPodcastArray['id'], $importedPodcastArray['podcast_id']); return array_merge($podcastArray, $importedPodcastArray); } if (!is_null($stationPodcast)) { // For now just return $podcastArray because StationPodcast objects do not have any // extra fields we want to return. This may change in the future. return $podcastArray; } return $podcastArray; } /** * Override this function so it updates the child class as well. * Child class will either be ImportedPodcast or StationPodcast. * * @param array $arr * @param string $keyType * * @throws Exception * @throws PropelException */ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { parent::fromArray($arr, $keyType); $importedPodcast = ImportedPodcastQuery::create()->filterByDbPodcastId($this->getDbId())->findOne(); if (!is_null($importedPodcast)) { $importedPodcast->fromArray($arr, $keyType); $importedPodcast->save(); } // TODO: station podcast } }