/** * 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'); } }
/** * Exclude object from result * * @param ChildObjectCategory $objectCategory Object to remove from the list of results * * @return $this|ChildObjectCategoryQuery The current query, for fluid interface */ public function prune($objectCategory = null) { if ($objectCategory) { $this->addCond('pruneCond0', $this->getAliasedColName(ObjectCategoryTableMap::COL_ID_OBJECT), $objectCategory->getIdObject(), Criteria::NOT_EQUAL); $this->addCond('pruneCond1', $this->getAliasedColName(ObjectCategoryTableMap::COL_ID_CATEGORY), $objectCategory->getIdCategory(), Criteria::NOT_EQUAL); $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR); } return $this; }