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