コード例 #1
0
 /**
  * Filter the query by a related Plan object
  *
  * @param   Plan|PropelObjectCollection $plan 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 filterByPlan($plan, $comparison = null)
 {
     if ($plan instanceof Plan) {
         return $this->addUsingAlias(AfiliadoPeer::PLAN_ID, $plan->getId(), $comparison);
     } elseif ($plan instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(AfiliadoPeer::PLAN_ID, $plan->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByPlan() only accepts arguments of type Plan or PropelCollection');
     }
 }