Conditions | 4 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | protected function parseAttributesWithKeys($attributes): array |
||
21 | { |
||
22 | $result = []; |
||
23 | if (is_array($attributes)) { |
||
24 | foreach ($attributes as $key => $field) { |
||
25 | $value = $this->model->getAttribute($field); |
||
26 | if (is_numeric($key)) { |
||
27 | $result[$field] = $value; |
||
28 | } else { |
||
29 | $result[$key] = $value; |
||
30 | } |
||
31 | } |
||
32 | } else { |
||
33 | $result[$attributes] = $this->model->getAttribute($attributes); |
||
34 | } |
||
35 | |||
36 | return $result; |
||
37 | } |
||
38 | |||
69 |