/** * Filter the query by a related Area object * * @param Area|PropelObjectCollection $area 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 filterByArea($area, $comparison = null) { if ($area instanceof Area) { return $this->addUsingAlias(StatePeer::ID, $area->getStateId(), $comparison); } elseif ($area instanceof PropelObjectCollection) { return $this->useAreaQuery()->filterByPrimaryKeys($area->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByArea() only accepts arguments of type Area or PropelCollection'); } }