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