Exemple #1
0
 /**
  * @internal
  *
  * @param BasketItem $basketItem
  * @return bool
  */
 public function addItem(BasketItem $basketItem)
 {
     /** @var BasketItem $basketItem */
     $basketItem = parent::addItem($basketItem);
     $basketItem->setCollection($this);
     /** @var Order $order */
     $order = $this->getOrder();
     if ($order) {
         $order->onBasketModify(EventActions::ADD, $basketItem);
     }
 }
Exemple #2
0
 /**
  * @internal
  *
  * @param Internals\CollectableEntity $basketItem
  * @return bool
  */
 public function addItem(Internals\CollectableEntity $basketItem)
 {
     /** @var BasketItem $basketItem */
     $basketItem = parent::addItem($basketItem);
     $basketItem->setCollection($this);
     /** @var Order $order */
     if ($order = $this->getOrder()) {
         $order->onBasketModify(EventActions::ADD, $basketItem);
     }
 }