Log   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 25
dl 0
loc 46
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A behaviors() 0 31 1
A search() 0 5 1
1
<?php
2
3
namespace execut\import\models;
4
use execut\crudFields\Behavior;
5
use execut\crudFields\BehaviorStub;
6
use execut\crudFields\fields\HasOneSelect2;
7
use execut\crudFields\ModelsHelperTrait;
8
use yii\behaviors\TimestampBehavior;
9
use yii\db\Expression;
10
11
class Log extends \execut\import\models\base\Log
12
{
13
    use ModelsHelperTrait, BehaviorStub;
14
15
    const MODEL_NAME = '{n,plural,=0{Files} =1{File} other{Files}}';
16
17
    public function behaviors()
18
    {
19
        return [
20
            'fields' => [
21
                'class' => Behavior::class,
22
                'module' => 'import',
23
                'fields' => $this->getStandardFields(['visible', 'name', 'actions'], [
24
//                    'file' => [
25
//                        'class' => HasOneSelect2::class,
26
//                        'attribute' => 'import_file_id',
27
//                        'relation' => 'file',
28
//                        'scope' => false,
29
//                    ],
30
                    'level',
31
                    'category',
32
                    'prefix',
33
                    'message',
34
                    'row_nbr',
35
                    'column_nbr',
36
                    'value',
37
                    'settingsValue' => [
38
                        'relation' => 'settingsValue',
39
                    ],
40
                ]),
41
                'plugins' => [],
42
            ],
43
            'date' => [
44
                'class' => TimestampBehavior::class,
45
                'createdAtAttribute' => 'created',
46
                'updatedAtAttribute' => 'updated',
47
                'value' => new Expression('NOW()'),
48
            ],
49
        ];
50
    }
51
52
    public function search()
53
    {
54
        $dataProvider = $this->getBehavior('fields')->search();
55
56
        return $dataProvider;
57
    }
58
}
59