/** * Filter the query by a related \INSEEGeo\Model\InseeGeoRegion object * * @param \INSEEGeo\Model\InseeGeoRegion|ObjectCollection $inseeGeoRegion The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildInseeGeoDepartmentQuery The current query, for fluid interface */ public function filterByInseeGeoRegion($inseeGeoRegion, $comparison = null) { if ($inseeGeoRegion instanceof \INSEEGeo\Model\InseeGeoRegion) { return $this->addUsingAlias(InseeGeoDepartmentTableMap::REGION_ID, $inseeGeoRegion->getId(), $comparison); } elseif ($inseeGeoRegion instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(InseeGeoDepartmentTableMap::REGION_ID, $inseeGeoRegion->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByInseeGeoRegion() only accepts arguments of type \\INSEEGeo\\Model\\InseeGeoRegion or Collection'); } }