/** * Filter the query by a related \ObjectCategory object * * @param \ObjectCategory|ObjectCollection $objectCategory the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildCategoryQuery The current query, for fluid interface */ public function filterByObjectCategory($objectCategory, $comparison = null) { if ($objectCategory instanceof \ObjectCategory) { return $this->addUsingAlias(CategoryTableMap::COL_ID, $objectCategory->getIdCategory(), $comparison); } elseif ($objectCategory instanceof ObjectCollection) { return $this->useObjectCategoryQuery()->filterByPrimaryKeys($objectCategory->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByObjectCategory() only accepts arguments of type \\ObjectCategory or Collection'); } }
/** * Filter the query by a related \Models\Article object * * @param \Models\Article|ObjectCollection $article the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildCategoryQuery The current query, for fluid interface */ public function filterByArticle($article, $comparison = null) { if ($article instanceof \Models\Article) { return $this->addUsingAlias(CategoryTableMap::COL_ID, $article->getIdCategory(), $comparison); } elseif ($article instanceof ObjectCollection) { return $this->useArticleQuery()->filterByPrimaryKeys($article->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByArticle() only accepts arguments of type \\Models\\Article or Collection'); } }