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