/** * Filter the query by a related Item object * * @param Item $item the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return BookQuery The current query, for fluid interface */ public function filterByItem($item, $comparison = null) { if ($item instanceof Item) { return $this->addUsingAlias(BookPeer::ISBN, $item->getIsbn(), $comparison); } elseif ($item instanceof PropelCollection) { return $this->useItemQuery()->filterByPrimaryKeys($item->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByItem() only accepts arguments of type Item or PropelCollection'); } }