/** * Filter the query by a related Matiere object * * @param Matiere $matiere the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CategorieMatiereQuery The current query, for fluid interface */ public function filterByMatiere($matiere, $comparison = null) { if ($matiere instanceof Matiere) { return $this ->addUsingAlias(CategorieMatierePeer::ID, $matiere->getCategorieId(), $comparison); } elseif ($matiere instanceof PropelCollection) { return $this ->useMatiereQuery() ->filterByPrimaryKeys($matiere->getPrimaryKeys()) ->endUse(); } else { throw new PropelException('filterByMatiere() only accepts arguments of type Matiere or PropelCollection'); } }