/** * Filter the query by a related \testpropel\Book object * * @param \testpropel\Book|ObjectCollection $book the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildAuthorQuery The current query, for fluid interface */ public function filterByBook($book, $comparison = null) { if ($book instanceof \testpropel\Book) { return $this->addUsingAlias(AuthorTableMap::COL_ID, $book->getAuthorId(), $comparison); } elseif ($book instanceof ObjectCollection) { return $this->useBookQuery()->filterByPrimaryKeys($book->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByBook() only accepts arguments of type \\testpropel\\Book or Collection'); } }