/**
  * Filter the query by a related \Thelia\Model\CartItem object
  *
  * @param \Thelia\Model\CartItem|ObjectCollection $cartItem The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildLegacyCartItemAttributeCombinationQuery The current query, for fluid interface
  */
 public function filterByCartItem($cartItem, $comparison = null)
 {
     if ($cartItem instanceof \Thelia\Model\CartItem) {
         return $this->addUsingAlias(LegacyCartItemAttributeCombinationTableMap::CART_ITEM_ID, $cartItem->getId(), $comparison);
     } elseif ($cartItem instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(LegacyCartItemAttributeCombinationTableMap::CART_ITEM_ID, $cartItem->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByCartItem() only accepts arguments of type \\Thelia\\Model\\CartItem or Collection');
     }
 }
Пример #2
0
 /**
  * Exclude object from result
  *
  * @param   ChildCartItem $cartItem Object to remove from the list of results
  *
  * @return ChildCartItemQuery The current query, for fluid interface
  */
 public function prune($cartItem = null)
 {
     if ($cartItem) {
         $this->addUsingAlias(CartItemTableMap::ID, $cartItem->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
 /**
  * Declares an association between this object and a ChildCartItem object.
  *
  * @param                  ChildCartItem $v
  * @return                 \LegacyProductAttributes\Model\LegacyCartItemAttributeCombination The current object (for fluent API support)
  * @throws PropelException
  */
 public function setCartItem(ChildCartItem $v = null)
 {
     if ($v === null) {
         $this->setCartItemId(NULL);
     } else {
         $this->setCartItemId($v->getId());
     }
     $this->aCartItem = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildCartItem object, it will not be re-added.
     if ($v !== null) {
         $v->addLegacyCartItemAttributeCombination($this);
     }
     return $this;
 }