/** * Filter the query by a related City object * * @param City|PropelObjectCollection $city the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return StateQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByCity($city, $comparison = null) { if ($city instanceof City) { return $this->addUsingAlias(StatePeer::ID, $city->getStateId(), $comparison); } elseif ($city instanceof PropelObjectCollection) { return $this->useCityQuery()->filterByPrimaryKeys($city->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByCity() only accepts arguments of type City or PropelCollection'); } }