/** * {@inheritdoc} */ public function removeUnit(OrderItemUnitInterface $unit) { if ($this->hasUnit($unit)) { $unit->setOrderItem(null); $this->units->removeElement($unit); } }
/** * {@inheritdoc} */ public function removeUnit(OrderItemUnitInterface $unit) { if ($this->hasUnit($unit)) { $this->units->removeElement($unit); --$this->quantity; $this->unitsTotal -= $unit->getTotal(); $this->recalculateTotal(); } }
/** * {@inheritdoc} */ public function removeUnit(OrderItemUnitInterface $unit) { if ($this->hasUnit($unit)) { $this->units->removeElement($unit); $this->quantity--; $this->unitsTotal -= $unit->getTotal(); $this->recalculateTotal(); if (null !== $this->order) { $this->order->calculateItemsTotal(); } } }