Esempio n. 1
0
 /**
  * Filter the query by a related \SpoilerWiki\Work object
  *
  * @param \SpoilerWiki\Work|ObjectCollection $work the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildArtistQuery The current query, for fluid interface
  */
 public function filterByWork($work, $comparison = null)
 {
     if ($work instanceof \SpoilerWiki\Work) {
         return $this->addUsingAlias(ArtistTableMap::COL_ID, $work->getPrimaryArtistId(), $comparison);
     } elseif ($work instanceof ObjectCollection) {
         return $this->useWorkQuery()->filterByPrimaryKeys($work->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByWork() only accepts arguments of type \\SpoilerWiki\\Work or Collection');
     }
 }