| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 4 | Features | 0 |
| 1 | <?php |
||
| 8 | public function split(Message $message) |
||
| 9 | { |
||
| 10 | $order = $message->getContent(); |
||
| 11 | $orderItems = $order->getItems(); |
||
| 12 | $items = []; |
||
| 13 | foreach ($orderItems as $item) { |
||
| 14 | $nr = $item['number']; |
||
| 15 | unset($item['number']); |
||
| 16 | $item['order'] = $order->getOrderNumber(); |
||
| 17 | for ($x = 0; $x < $nr; $x++) { |
||
| 18 | $items[] = $item; |
||
| 19 | } |
||
| 20 | } |
||
| 21 | echo PEIP_LINE_SEPARATOR.'OrderSplitter: split order #: '.$order->getOrderNumber(); |
||
| 22 | |||
| 23 | return $items; |
||
| 24 | } |
||
| 25 | } |
||
| 26 |