Passed
Push — master ( 8cf58c...3a8f57 )
by Paweł
02:46
created

TagInvalidationType   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 3 1
A rules() 0 5 1
A attributeLabels() 0 5 1
A getTags() 0 3 1
1
<?php
2
3
namespace app\models;
4
5
use Yii;
6
7
/**
8
 * This is the model class for table "tag_invalidation_type".
9
 *
10
 * @property int $id
11
 * @property string $name
12
 *
13
 * @property Tag[] $tags
14
 */
15
class TagInvalidationType extends \yii\db\ActiveRecord
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public static function tableName()
21
    {
22
        return 'tag_invalidation_type';
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function rules()
29
    {
30
        return [
31
            [['name'], 'required'],
32
            [['name'], 'string', 'max' => 255],
33
        ];
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function attributeLabels()
40
    {
41
        return [
42
            'id' => 'ID',
43
            'name' => 'Name',
44
        ];
45
    }
46
47
    /**
48
     * @return \yii\db\ActiveQuery
49
     */
50
    public function getTags()
51
    {
52
        return $this->hasMany(Tag::className(), ['invalidation_type_id' => 'id']);
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

52
        return $this->hasMany(/** @scrutinizer ignore-deprecated */ Tag::className(), ['invalidation_type_id' => 'id']);

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...
53
    }
54
}
55