Conditions | 6 |
Paths | 8 |
Total Lines | 24 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | public function fill(array $data) { |
||
14 | |||
15 | if (0 !== $this->id) return false; |
||
16 | |||
17 | $set = $this->definition->implement($data, true); |
||
18 | |||
19 | if (!($set['id'] > 0)) return false; |
||
20 | |||
21 | # Re-init entity |
||
22 | |||
23 | $this->error = false; $this->id = $set['id']; |
||
24 | |||
25 | foreach ($set as $name => $value) if ($name !== 'id') $this->data[$name] = $value; |
||
26 | |||
27 | if (static::$nesting) $this->data['path'] = $this->getPath(); |
||
28 | |||
29 | # Implement entity |
||
30 | |||
31 | $this->implement(); |
||
32 | |||
33 | # ------------------------ |
||
34 | |||
35 | return true; |
||
36 | } |
||
37 | |||
47 |