Example #1
0
 /**
  * Filter the query by a related Item object
  *
  * @param   Item|PropelObjectCollection $item  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return   ItemTypeQuery 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(ItemTypePeer::ID, $item->getItemTypeId(), $comparison);
     } elseif ($item instanceof PropelObjectCollection) {
         return $this->useItemQuery()->filterByPrimaryKeys($item->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByItem() only accepts arguments of type Item or PropelCollection');
     }
 }