/** * Filter the query by a related \Subcategories object * * @param \Subcategories|ObjectCollection $subcategories 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 ChildItemsQuery The current query, for fluid interface */ public function filterBySubcategories($subcategories, $comparison = null) { if ($subcategories instanceof \Subcategories) { return $this->addUsingAlias(ItemsTableMap::COL_SUBCATEGORY_ID, $subcategories->getSubcategoryId(), $comparison); } elseif ($subcategories instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ItemsTableMap::COL_SUBCATEGORY_ID, $subcategories->toKeyValue('PrimaryKey', 'SubcategoryId'), $comparison); } else { throw new PropelException('filterBySubcategories() only accepts arguments of type \\Subcategories or Collection'); } }