/**
  * Filter the query by a related Localidad object
  *
  * @param   Localidad|PropelObjectCollection $localidad The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return   AfiliadoQuery The current query, for fluid interface
  * @throws   PropelException - if the provided filter is invalid.
  */
 public function filterByLocalidad($localidad, $comparison = null)
 {
     if ($localidad instanceof Localidad) {
         return $this->addUsingAlias(AfiliadoPeer::LOCALIDAD_ID, $localidad->getId(), $comparison);
     } elseif ($localidad instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(AfiliadoPeer::LOCALIDAD_ID, $localidad->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByLocalidad() only accepts arguments of type Localidad or PropelCollection');
     }
 }