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