/** * fake for test */ public function findOne(ConnectionInterface $con = null) { if (true === $this->bySlug) { $book = new Book(); $book->setId(1); $book->setName('My Book'); $book->setSlug('my-book'); return $book; } elseif (true === $this->byAuthorSlug) { $book = new Book(); $book->setId(2); $book->setName('My Kewl Book'); $book->setSlug('my-kewl-book'); return $book; } return null; }
/** * Exclude object from result * * @param ChildBook $book Object to remove from the list of results * * @return ChildBookQuery The current query, for fluid interface */ public function prune($book = null) { if ($book) { $this->addUsingAlias(BookTableMap::ID, $book->getId(), Criteria::NOT_EQUAL); } return $this; }