Esempio n. 1
0
 /**
  * Filter the query by a related Book object
  *
  * @param   Book|PropelObjectCollection $book  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 AuthorQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByBook($book, $comparison = null)
 {
     if ($book instanceof Book) {
         return $this->addUsingAlias(AuthorPeer::ID, $book->getAuthorId(), $comparison);
     } elseif ($book instanceof PropelObjectCollection) {
         return $this->useBookQuery()->filterByPrimaryKeys($book->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByBook() only accepts arguments of type Book or PropelCollection');
     }
 }