Esempio n. 1
0
 /**
  * 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                 CityQuery 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(CityPeer::ID, $area->getCityId(), $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');
     }
 }