예제 #1
0
 /**
  * Filter the query by a related \App\Propel\Promotion object
  *
  * @param \App\Propel\Promotion|ObjectCollection $promotion the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildResourceQuery The current query, for fluid interface
  */
 public function filterByPromotion($promotion, $comparison = null)
 {
     if ($promotion instanceof \App\Propel\Promotion) {
         return $this->addUsingAlias(ResourceTableMap::COL_RESOURCE_ID, $promotion->getResourceId(), $comparison);
     } elseif ($promotion instanceof ObjectCollection) {
         return $this->usePromotionQuery()->filterByPrimaryKeys($promotion->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByPromotion() only accepts arguments of type \\App\\Propel\\Promotion or Collection');
     }
 }