/** * Filter the query by a related \Books object * * @param \Books|ObjectCollection $books 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 ChildRBatchForbookQuery The current query, for fluid interface */ public function filterByBooks($books, $comparison = null) { if ($books instanceof \Books) { return $this->addUsingAlias(RBatchForbookTableMap::COL__BOOKID, $books->getId(), $comparison); } elseif ($books instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(RBatchForbookTableMap::COL__BOOKID, $books->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByBooks() only accepts arguments of type \\Books or Collection'); } }