| @@ 206-217 (lines=12) @@ | ||
| 203 | /** |
|
| 204 | * {@inheritdoc} |
|
| 205 | */ |
|
| 206 | public function addItem(OrderItemInterface $item) |
|
| 207 | { |
|
| 208 | if ($this->hasItem($item)) { |
|
| 209 | return; |
|
| 210 | } |
|
| 211 | ||
| 212 | $this->itemsTotal += $item->getTotal(); |
|
| 213 | $this->items->add($item); |
|
| 214 | $item->setOrder($this); |
|
| 215 | ||
| 216 | $this->recalculateTotal(); |
|
| 217 | } |
|
| 218 | ||
| 219 | /** |
|
| 220 | * {@inheritdoc} |
|
| @@ 222-230 (lines=9) @@ | ||
| 219 | /** |
|
| 220 | * {@inheritdoc} |
|
| 221 | */ |
|
| 222 | public function removeItem(OrderItemInterface $item) |
|
| 223 | { |
|
| 224 | if ($this->hasItem($item)) { |
|
| 225 | $this->items->removeElement($item); |
|
| 226 | $this->itemsTotal -= $item->getTotal(); |
|
| 227 | $this->recalculateTotal(); |
|
| 228 | $item->setOrder(null); |
|
| 229 | } |
|
| 230 | } |
|
| 231 | ||
| 232 | /** |
|
| 233 | * {@inheritdoc} |
|