/**
  * Filter the query by a related \ECP\ItemFilterType object
  *
  * @param \ECP\ItemFilterType|ObjectCollection $itemFilterType the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildFittingRuleRowQuery The current query, for fluid interface
  */
 public function filterByItemFilterType($itemFilterType, $comparison = null)
 {
     if ($itemFilterType instanceof \ECP\ItemFilterType) {
         return $this->addUsingAlias(FittingRuleRowTableMap::COL_ID, $itemFilterType->getFittingrulerowid(), $comparison);
     } elseif ($itemFilterType instanceof ObjectCollection) {
         return $this->useItemFilterTypeQuery()->filterByPrimaryKeys($itemFilterType->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByItemFilterType() only accepts arguments of type \\ECP\\ItemFilterType or Collection');
     }
 }
 private function updateItemFilterTypes($connection, $typeArray, $fittingRuleRow)
 {
     $itemFilterTypeDict = array();
     foreach ($fittingRuleRow->getItemFilterTypes() as $itemFilterType) {
         $itemFilterTypeDict[$itemFilterType->getItemId()] = $itemFilterType;
     }
     foreach ($typeArray as $dataTypeId) {
         $itemFilterTypeExists = array_key_exists($dataTypeId, $itemFilterTypeDict);
         $itemFilterType = null;
         if ($itemFilterTypeExists) {
             $itemFilterType = $itemFilterTypeDict[$dataTypeId];
         } else {
             $itemFilterType = new ECP\ItemFilterType();
             $itemFilterType->setItemId($dataTypeId);
         }
         $this->prepareSubentitySave2($connection, $fittingRuleRow, 'ItemFilterType', $itemFilterType, !$itemFilterTypeExists);
     }
     foreach ($itemFilterTypeDict as $itemId => $itemFilterType) {
         if (!in_array($itemId, $typeArray)) {
             $fittingRuleRow->removeItemFilterType($itemFilterType);
         }
     }
     $fittingRuleRow->save($connection);
 }
 /**
  * Exclude object from result
  *
  * @param   ChildItemFilterType $itemFilterType Object to remove from the list of results
  *
  * @return $this|ChildItemFilterTypeQuery The current query, for fluid interface
  */
 public function prune($itemFilterType = null)
 {
     if ($itemFilterType) {
         $this->addUsingAlias(ItemFilterTypeTableMap::COL_ID, $itemFilterType->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
 /**
  * @param ChildItemFilterType $itemFilterType The ChildItemFilterType object to add.
  */
 protected function doAddItemFilterType(ChildItemFilterType $itemFilterType)
 {
     $this->collItemFilterTypes[] = $itemFilterType;
     $itemFilterType->setFittingRuleRow($this);
 }