예제 #1
0
 /**
  * Filter the query by a related Item object
  *
  * @param   Item|PropelObjectCollection $item The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return   BuyListingQuery The current query, for fluid interface
  * @throws   PropelException - if the provided filter is invalid.
  */
 public function filterByItem($item, $comparison = null)
 {
     if ($item instanceof Item) {
         return $this->addUsingAlias(BuyListingPeer::ITEM_ID, $item->getDataId(), $comparison);
     } elseif ($item instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(BuyListingPeer::ITEM_ID, $item->toKeyValue('PrimaryKey', 'DataId'), $comparison);
     } else {
         throw new PropelException('filterByItem() only accepts arguments of type Item or PropelCollection');
     }
 }