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