Пример #1
0
 /**
  * Filter the query by a related Corporation object
  *
  * @param   Corporation|PropelObjectCollection $corporation The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 CourtQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByCorporation($corporation, $comparison = null)
 {
     if ($corporation instanceof Corporation) {
         return $this->addUsingAlias(CourtPeer::CORPORATION_ID, $corporation->getId(), $comparison);
     } elseif ($corporation instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(CourtPeer::CORPORATION_ID, $corporation->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByCorporation() only accepts arguments of type Corporation or PropelCollection');
     }
 }