Example #1
0
 /**
  * @inheritdoc
  */
 public function addChild(OrderItemInterface $item)
 {
     if (!$this->children->contains($item)) {
         $item->setParent($this);
         $this->children->add($item);
     }
     return $this;
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function addItem(OrderItemInterface $item)
 {
     if ($this->hasItem($item)) {
         return;
     }
     $this->itemsTotal += $item->getTotal();
     $this->items->add($item);
     $item->setOrder($this);
     $this->recalculateTotal();
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function addItem(OrderItemInterface $item)
 {
     if ($this->hasItem($item)) {
         return;
     }
     foreach ($this->items as $existingItem) {
         if ($item->equals($existingItem)) {
             $existingItem->merge($item, false);
             return;
         }
     }
     $item->setOrder($this);
     $this->items->add($item);
 }
Example #4
0
 /**
  * @inheritdoc
  */
 public function addItem(OrderItemInterface $item)
 {
     if (!$this->hasItem($item)) {
         $item->setOrder($this);
         $this->items->add($item);
     }
     return $this;
 }