/** * Filter the query by a related \App\Propel\Category object * * @param \App\Propel\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 ChildResourceQuery The current query, for fluid interface */ public function filterByCategory($category, $comparison = null) { if ($category instanceof \App\Propel\Category) { return $this->addUsingAlias(ResourceTableMap::COL_RESOURCE_ID, $category->getResourceId(), $comparison); } elseif ($category instanceof ObjectCollection) { return $this->useCategoryQuery()->filterByPrimaryKeys($category->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByCategory() only accepts arguments of type \\App\\Propel\\Category or Collection'); } }