Conditions | 4 |
Paths | 6 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public function processOrderShipment(OrderInterface $order) |
||
39 | { |
||
40 | if ($order->hasShipments()) { |
||
41 | $shipment = $order->getShipments()->first(); |
||
42 | } else { |
||
43 | $shipment = $this->shipmentFactory->createNew(); |
||
44 | $order->addShipment($shipment); |
||
45 | } |
||
46 | |||
47 | foreach ($order->getItemUnits() as $itemUnit) { |
||
48 | if (null === $itemUnit->getShipment()) { |
||
49 | $shipment->addUnit($itemUnit); |
||
50 | } |
||
51 | } |
||
52 | } |
||
53 | } |
||
54 |