| Conditions | 3 |
| Paths | 2 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function run($id) |
||
| 33 | { |
||
| 34 | /* @var $model \yii\db\ActiveRecordInterface */ |
||
| 35 | $model = $this->findModel($id); |
||
| 36 | $request = Yii::$app->getRequest(); |
||
| 37 | $this->checkAccess($model, $request->getQueryParams()); |
||
| 38 | $model->scenario = $this->scenario; |
||
| 39 | $model->load( |
||
| 40 | $request->getBodyParams() + $this->parseFileAttributes(), |
||
| 41 | '' |
||
| 42 | ); |
||
| 43 | if ($model->save() === false && !$model->hasErrors()) { |
||
| 44 | throw new ServerErrorHttpException('Failed to update the object for unknown reason.'); |
||
| 45 | } |
||
| 46 | |||
| 47 | return $model; |
||
| 48 | } |
||
| 49 | } |
||
| 50 |