Html::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 9
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
// This class was automatically generated by a giiant build task
3
// You should not change it manually as it will be overwritten on next build
4
5
namespace app\modules\prototype\models\base;
6
7
use Yii;
8
9
/**
10
 * This is the base-model class for table "app_html".
11
 *
12
 * @property integer $id
13
 * @property string $key
14
 * @property string $value
15
 */
16 View Code Duplication
abstract class Html extends \yii\db\ActiveRecord
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public static function tableName()
24
    {
25
        return 'app_html';
26
    }
27
28
    /**
29
     * @inheritdoc
30
     * @return \app\modules\prototype\models\query\HtmlQuery the active query used by this AR class.
31
     */
32
    public static function find()
33
    {
34
        return new \app\modules\prototype\models\query\HtmlQuery(get_called_class());
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40
    public function rules()
41
    {
42
        return [
43
            [['key', 'value'], 'required'],
44
            [['value'], 'string'],
45
            [['key'], 'string', 'max' => 255],
46
            [['key'], 'unique']
47
        ];
48
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53
    public function attributeLabels()
54
    {
55
        return [
56
            'id' => Yii::t('app', 'ID'),
57
            'key' => Yii::t('app', 'Key'),
58
            'value' => Yii::t('app', 'Value'),
59
        ];
60
    }
61
62
63
}
64