Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
14 | public function createByModelAttributes($model, $map) |
||
15 | { |
||
16 | $result = []; |
||
17 | |||
18 | foreach ($map as $attributeName => $sql) { |
||
19 | $attribute = $model->hasAttribute($attributeName) |
||
20 | ? $model->getAttribute($attributeName) |
||
21 | : $model->getRelatedAttribute($attributeName); |
||
22 | |||
23 | $result[] = new Field($attributeName, $sql, $attribute); |
||
24 | } |
||
25 | |||
26 | return $result; |
||
27 | } |
||
28 | } |
||
29 |