Conditions | 6 |
Paths | 5 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function get($fields) |
||
16 | { |
||
17 | $data = new Data($this->data); |
||
18 | $result = new Data(); |
||
19 | foreach ($fields as $key => $label) { |
||
20 | $item = $data->get($key); |
||
21 | if (isset($item)) { |
||
22 | if ($label == '.') { |
||
23 | if (!is_array($item)) { |
||
24 | return $item; |
||
25 | } |
||
26 | foreach ($item as $key => $value) { |
||
27 | $result->set($key, $value); |
||
28 | } |
||
29 | } else { |
||
30 | $result->set($label, $data->get($key)); |
||
31 | } |
||
32 | } |
||
33 | } |
||
34 | return $result->export(); |
||
35 | } |
||
36 | } |
||
37 |