Conditions | 5 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function reverseTransform($data) |
||
35 | { |
||
36 | if (null === $data) { |
||
37 | return null; |
||
38 | } |
||
39 | |||
40 | if (is_array($data) || is_object($data)) { |
||
41 | $collection = array(); |
||
42 | |||
43 | foreach ($data as $id) { |
||
44 | $collection[] = $this->manager->getRepository()->findOneBy(['id' => $id]); |
||
45 | } |
||
46 | |||
47 | return $collection; |
||
48 | } |
||
49 | |||
50 | $model = $this->manager->getRepository()->findOneBy(['id' => $data]); |
||
51 | |||
52 | return $model; |
||
53 | } |
||
54 | |||
81 |