/** * Filter the query by a related Songs object * * @param Songs|PropelObjectCollection $songs the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return AlbumQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterBySongs($songs, $comparison = null) { if ($songs instanceof Songs) { return $this->addUsingAlias(AlbumPeer::ID, $songs->getAlbumId(), $comparison); } elseif ($songs instanceof PropelObjectCollection) { return $this->useSongsQuery()->filterByPrimaryKeys($songs->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterBySongs() only accepts arguments of type Songs or PropelCollection'); } }