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