| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2.0078 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 63 | 6 | public function update($id, array $data = []) |
|
| 64 | { |
||
| 65 | 6 | if (!$model = $this->read($id)) { |
|
| 66 | 2 | $this->throwException(Lang::get('support.exceptions.model.read')); |
|
| 67 | } |
||
| 68 | |||
| 69 | 4 | $this->validate($data); |
|
| 70 | |||
| 71 | 2 | $this->updateAttributes($model, $data); |
|
| 72 | |||
| 73 | 2 | $model->save(); |
|
| 74 | |||
| 75 | 2 | return $model; |
|
| 76 | } |
||
| 77 | |||
| 92 |