Conditions | 4 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
33 | public function run($id) |
||
34 | { |
||
35 | $model = SchedulerTask::findOne($id); |
||
36 | $request = Yii::$app->getRequest(); |
||
37 | |||
38 | if (!$model) { |
||
|
|||
39 | throw new \yii\web\HttpException(404, 'The requested page does not exist.'); |
||
40 | } |
||
41 | |||
42 | if ($model->load($request->post())) { |
||
43 | $model->save(); |
||
44 | } |
||
45 | |||
46 | $logModel = new SchedulerLog(); |
||
47 | $logModel->scheduler_task_id = $model->id; |
||
48 | $logDataProvider = $logModel->search($_GET); |
||
49 | |||
50 | return $this->controller->render($this->view ?: $this->id, [ |
||
51 | 'model' => $model, |
||
52 | 'logModel' => $logModel, |
||
53 | 'logDataProvider' => $logDataProvider, |
||
54 | ]); |
||
57 |