Issues (75)

app/Model/AuthItem.php (5 issues)

1
<?php
2
namespace App\Model;
3
4
use Yii;
5
use yii\behaviors\TimestampBehavior;
6
7
/**
8
 * This is the model class for table "{{%auth_item}}".
9
 *
10
 * @property string $name
11
 * @property int $type
12
 * @property string $description
13
 * @property string $rule_name
14
 * @property resource $data
15
 * @property int $created_at
16
 * @property int $updated_at
17
 *
18
 * @property AuthAssignment[] $authAssignments
19
 * @property AuthRule $ruleName
20
 * @property AuthItemChild[] $authItemChildren
21
 * @property AuthItemChild[] $authItemChildren0
22
 * @property AuthItem[] $children
23
 * @property AuthItem[] $parents
24
 */
25
class AuthItem extends ActiveRecord
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public static function tableName()
31
    {
32
        return '{{%auth_item}}';
33
    }
34
35
    public function behaviors()
36
    {
37
        return [
38
            TimestampBehavior::class,
39
        ];
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function rules()
46
    {
47
        return [
48
            [['name', 'type'], 'required'],
49
            [['type', 'created_at', 'updated_at'], 'integer'],
50
            [['description', 'data'], 'string'],
51
            [['name'], 'string', 'max' => 64],
52
            [['name'], 'unique'],
53
        ];
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function attributeLabels()
60
    {
61
        return [
62
            'name' => Yii::t('app', 'Name'),
63
            'type' => Yii::t('app', 'Type'),
64
            'description' => Yii::t('app', 'Description'),
65
            'rule_name' => Yii::t('app', 'Rule Name'),
66
            'data' => Yii::t('app', 'Data'),
67
            'created_at' => Yii::t('app', 'Created At'),
68
            'updated_at' => Yii::t('app', 'Updated At'),
69
        ];
70
    }
71
72
    /**
73
     * @return \yii\db\ActiveQuery
74
     */
75
    public function getAuthAssignments()
76
    {
77
        return $this->hasMany(AuthAssignment::className(), ['item_name' => 'name']);
0 ignored issues
show
The type App\Model\AuthAssignment was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
78
    }
79
80
    /**
81
     * @return \yii\db\ActiveQuery
82
     */
83
    public function getRuleName()
84
    {
85
        return $this->hasOne(AuthRule::className(), ['name' => 'rule_name']);
0 ignored issues
show
The type App\Model\AuthRule was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
86
    }
87
88
    /**
89
     * @return \yii\db\ActiveQuery
90
     */
91
    public function getAuthItemChildren()
92
    {
93
        return $this->hasMany(AuthItemChild::className(), ['parent' => 'name']);
0 ignored issues
show
The type App\Model\AuthItemChild was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
94
    }
95
96
    /**
97
     * @return \yii\db\ActiveQuery
98
     */
99
    public function getAuthItemChildren0()
100
    {
101
        return $this->hasMany(AuthItemChild::className(), ['child' => 'name']);
102
    }
103
104
    /**
105
     * @return \yii\db\ActiveQuery
106
     */
107
    public function getChildren()
108
    {
109
        return $this->hasMany(AuthItem::className(), ['name' => 'child'])->viaTable('{{%auth_item_child}}', ['parent' => 'name']);
0 ignored issues
show
Deprecated Code introduced by
The function yii\base\BaseObject::className() has been deprecated: since 2.0.14. On PHP >=5.5, use `::class` instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

109
        return $this->hasMany(/** @scrutinizer ignore-deprecated */ AuthItem::className(), ['name' => 'child'])->viaTable('{{%auth_item_child}}', ['parent' => 'name']);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
110
    }
111
112
    /**
113
     * @return \yii\db\ActiveQuery
114
     */
115
    public function getParents()
116
    {
117
        return $this->hasMany(AuthItem::className(), ['name' => 'parent'])->viaTable('{{%auth_item_child}}', ['child' => 'name']);
0 ignored issues
show
Deprecated Code introduced by
The function yii\base\BaseObject::className() has been deprecated: since 2.0.14. On PHP >=5.5, use `::class` instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

117
        return $this->hasMany(/** @scrutinizer ignore-deprecated */ AuthItem::className(), ['name' => 'parent'])->viaTable('{{%auth_item_child}}', ['child' => 'name']);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
118
    }
119
120
    public function fields()
121
    {
122
        return [
123
            'name',
124
            'description',
125
            'create_time' => 'created_at',
126
            'update_time' => 'updated_at',
127
        ];
128
    }
129
}
130