Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function deserialize(array $data) |
||
32 | { |
||
33 | $cart = new Cart(); |
||
34 | foreach ($data['rows'] as $id => $row) { |
||
35 | $meal = $this->manager->getRepository('AppBundle:Meal')->find($id); |
||
36 | if (!$meal) { |
||
37 | continue; |
||
38 | } |
||
39 | |||
40 | $row = new CartRow($meal, $row['quantity']); |
||
41 | $cart->addRow($row); |
||
42 | } |
||
43 | |||
44 | return $cart; |
||
45 | } |
||
46 | } |
||
47 |