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