LanguageController::actionDelete()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
nc 2
nop 1
dl 0
loc 7
c 0
b 0
f 0
cc 2
rs 10
1
<?php
2
3
namespace app\controllers\admin;
4
5
use app\traits\{LanguageTrait, AdminBeforeActionTrait, AccessTrait};
6
use Itstructure\AdminModule\controllers\LanguageController as BaseLanguageController;
7
8
/**
9
 * Class LanguageController
10
 * LanguageController implements the CRUD actions for Language model.
11
 *
12
 * @package app\controllers\admin
13
 *
14
 * @author Andrey Girnik <[email protected]>
15
 */
16
class LanguageController extends BaseLanguageController
17
{
18
    use LanguageTrait, AdminBeforeActionTrait, AccessTrait;
0 ignored issues
show
Bug introduced by
The trait app\traits\AccessTrait requires the property $user which is not provided by app\controllers\admin\LanguageController.
Loading history...
Bug introduced by
The trait app\traits\AdminBeforeActionTrait requires the property $controller which is not provided by app\controllers\admin\LanguageController.
Loading history...
19
20
    /**
21
     * @param $languageId
22
     *
23
     * @return mixed
24
     */
25
    public function actionSetDefault($languageId)
26
    {
27
        if (!$this->checkAccessToUpdate()) {
28
            return $this->accessError();
29
        }
30
31
        return parent::actionSetDefault($languageId);
32
    }
33
34
    /**
35
     * @return mixed|string
36
     */
37
    public function actionIndex()
38
    {
39
        if (!$this->checkAccessToIndex()) {
40
            return $this->accessError();
41
        }
42
43
        return parent::actionIndex();
44
    }
45
46
    /**
47
     * @param int|string $id
48
     *
49
     * @return mixed
50
     */
51
    public function actionView($id)
52
    {
53
        if (!$this->checkAccessToView()) {
54
            return $this->accessError();
55
        }
56
57
        return parent::actionView($id);
58
    }
59
60
    /**
61
     * @return mixed|string|\yii\web\Response
62
     */
63
    public function actionCreate()
64
    {
65
        if (!$this->checkAccessToCreate()) {
66
            return $this->accessError();
67
        }
68
69
        return parent::actionCreate();
70
    }
71
72
    /**
73
     * @param int|string $id
74
     *
75
     * @return string|\yii\web\Response
76
     */
77
    public function actionUpdate($id)
78
    {
79
        if (!$this->checkAccessToUpdate()) {
80
            return $this->accessError();
81
        }
82
83
        return parent::actionUpdate($id);
84
    }
85
86
    /**
87
     * @param int|string $id
88
     *
89
     * @return mixed|\yii\web\Response
90
     */
91
    public function actionDelete($id)
92
    {
93
        if (!$this->checkAccessToDelete()) {
94
            return $this->accessError();
95
        }
96
97
        return parent::actionDelete($id);
98
    }
99
}
100