Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
47 | public function run($id) |
||
48 | { |
||
49 | $model = $this->findModel($id); |
||
50 | |||
51 | if ($this->checkAccess) { |
||
52 | call_user_func($this->checkAccess, $this->id, $model); |
||
53 | } |
||
54 | |||
55 | $this->_model = $model; |
||
56 | |||
57 | if ($model->delete() === false) { |
||
58 | throw new ServerErrorHttpException('Failed to delete the object for unknown reason.'); |
||
59 | } |
||
60 | |||
61 | Yii::$app->getResponse()->setStatusCode(204); |
||
62 | } |
||
64 |