FilesStatuse::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace execut\import\models\base;
4
5
use Yii;
6
use yii\db\ActiveRecord;
7
use yii\helpers\ArrayHelper;
8
9
/**
10
 * This is the model class for table "import_files_statuses".
11
 *
12
 * @property integer $id
13
 * @property string $created
14
 * @property string $updated
15
 * @property string $name
16
 * @property string $key
17
 *
18
 * @property \execut\import\models\File[] $importFiles
19
 */
20
class FilesStatuse extends ActiveRecord
21
{
22
    /**
23
     * @inheritdoc
24
     */
25
    public static function tableName()
26
    {
27
        return 'import_files_statuses';
28
    }
29
30
    /**
31
     * @inheritdoc
32
     */
33
    public function rules()
34
    {
35
        return ArrayHelper::merge(parent::rules(), [
36
            [['created', 'updated'], 'safe'],
37
            [['name', 'key'], 'required'],
38
            [['name', 'key'], 'string', 'max' => 255],
39
        ]);
40
    }
41
42
    /**
43
     * @return \yii\db\ActiveQuery
44
     */
45
    public function getFiles()
46
    {
47
        return $this->hasMany(\execut\import\models\File::class, ['import_files_statuse_id' => 'id'])->inverseOf('filesStatuse');
48
    }
49
}
50