/** * Filter the query by a related \Book object * * @param \Book|ObjectCollection $book The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @throws \Propel\Runtime\Exception\PropelException * * @return ChildVerseQuery The current query, for fluid interface */ public function filterByBook($book, $comparison = null) { if ($book instanceof \Book) { return $this->addUsingAlias(VerseTableMap::COL_BOOK_ID, $book->getId(), $comparison); } elseif ($book instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(VerseTableMap::COL_BOOK_ID, $book->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByBook() only accepts arguments of type \\Book or Collection'); } }
/** * Exclude object from result * * @param ChildBook $book Object to remove from the list of results * * @return $this|ChildBookQuery The current query, for fluid interface */ public function prune($book = null) { if ($book) { $this->addUsingAlias(BookTableMap::COL_ID, $book->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a ChildBook object. * * @param ChildBook $v * @return $this|\Verse The current object (for fluent API support) * @throws PropelException */ public function setBook(ChildBook $v = null) { // aggregate_column_relation behavior if (null !== $this->aBook && $v !== $this->aBook) { $this->oldBookNumberOfVerses = $this->aBook; } // aggregate_column_relation behavior if (null !== $this->aBook && $v !== $this->aBook) { $this->oldBookNumberOfChapters = $this->aBook; } if ($v === null) { $this->setBookId(NULL); } else { $this->setBookId($v->getId()); } $this->aBook = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildBook object, it will not be re-added. if ($v !== null) { $v->addVerse($this); } return $this; }