/** * Filter the query by a related Matiere object * * @param Matiere|PropelCollection $matiere The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return JProfesseursMatieresQuery The current query, for fluid interface */ public function filterByMatiere($matiere, $comparison = null) { if ($matiere instanceof Matiere) { return $this ->addUsingAlias(JProfesseursMatieresPeer::ID_MATIERE, $matiere->getMatiere(), $comparison); } elseif ($matiere instanceof PropelCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this ->addUsingAlias(JProfesseursMatieresPeer::ID_MATIERE, $matiere->toKeyValue('PrimaryKey', 'Matiere'), $comparison); } else { throw new PropelException('filterByMatiere() only accepts arguments of type Matiere or PropelCollection'); } }