| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | protected function massAssignAttributes($data = []) |
||
| 30 | { |
||
| 31 | if ( ! is_array($data)) { |
||
| 32 | return $this; |
||
| 33 | } |
||
| 34 | |||
| 35 | foreach ($data as $key => $value) { |
||
| 36 | if ( method_exists($this, 'set' . ucfirst($key)) |
||
| 37 | // && in_array($key, array_merge($this->parametersRequired, $this->parametersOptional)) |
||
| 38 | ) { |
||
| 39 | $this->{'set' . $key}($value); |
||
| 40 | }else{ |
||
| 41 | $this->$key = $value; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | return $this; |
||
| 46 | } |
||
| 47 | |||
| 68 |