| Conditions | 4 |
| Paths | 4 |
| Total Lines | 27 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | protected function setOrderDetails() |
||
| 25 | { |
||
| 26 | $details = ArrayList::create(); |
||
| 27 | |||
| 28 | /** @var ArrayList $products */ |
||
| 29 | $products = $this->getTransaction()->getParsedTransactionData()->products; |
||
| 30 | |||
| 31 | /** @var ArrayData $detail */ |
||
| 32 | foreach ($products as $detail) { |
||
| 33 | $orderDetail = OrderDetail::create(); |
||
| 34 | |||
| 35 | foreach ($this->config()->get('order_detail_mapping') as $foxy => $ssFoxy) { |
||
| 36 | if ($detail->hasField($foxy)) { |
||
| 37 | $orderDetail->{$ssFoxy} = $detail->getField($foxy); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | $orderDetail->write(); |
||
| 42 | |||
| 43 | $orderDetail->OrderOptions()->addMany(OrderOptionFactory::create($detail)->getOrderOptions()); |
||
| 44 | |||
| 45 | $details->push($orderDetail); |
||
| 46 | } |
||
| 47 | |||
| 48 | $this->order_details = $details; |
||
| 49 | |||
| 50 | return $this; |
||
| 51 | } |
||
| 66 |