Exemplo n.º 1
0
 /**
  * Filter the query by a related Book object
  *
  * @param     Book|PropelCollection $book The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    ItemQuery The current query, for fluid interface
  */
 public function filterByBook($book, $comparison = null)
 {
     if ($book instanceof Book) {
         return $this->addUsingAlias(ItemPeer::ISBN, $book->getIsbn(), $comparison);
     } elseif ($book instanceof PropelCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(ItemPeer::ISBN, $book->toKeyValue('PrimaryKey', 'Isbn'), $comparison);
     } else {
         throw new PropelException('filterByBook() only accepts arguments of type Book or PropelCollection');
     }
 }