/** * {@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(); } } }