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

Tag::scenarios()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created for IG Monitoring.
4
 * User: jakim <[email protected]>
5
 * Date: 23.01.2018
6
 */
7
8
namespace app\modules\admin\models;
9
10
11
use app\components\ArrayHelper;
12
13
class Tag extends \app\models\Tag
14
{
15
    public $ts_media;
16
    public $ts_likes;
17
    public $ts_comments;
18
    public $ts_min_likes;
19
    public $ts_max_likes;
20
    public $ts_min_comments;
21
    public $ts_max_comments;
22
    public $ts_created_at;
23
24
    public function scenarios()
25
    {
26
        $scenarios = parent::scenarios();
27
        $scenarios[self::SCENARIO_UPDATE] = [
28
            'is_valid',
29
            'disabled',
30
        ];
31
32
        return $scenarios;
33
    }
34
35
    public function attributeLabels()
36
    {
37
        return ArrayHelper::merge(parent::attributeLabels(), [
38
            'ts_media' => 'Media',
39
            'ts_likes' => 'Likes',
40
            'ts_comments' => 'Comments',
41
            'ts_min_likes' => 'Min Likes',
42
            'ts_max_likes' => 'Max Likes',
43
            'ts_min_comments' => 'Min Comments',
44
            'ts_max_comments' => 'Max Comments',
45
            'ts_created_at' => 'Created At',
46
            'is_valid' => 'Is Valid - an exclamation triangle in the list of tags, is set automatically if the tag is not reachable. Check this option if you are sure that this tag is valid and want to try to refresh stats again.',
47
            'disabled' => 'Disabled - the tag will disappear from the monitoring list.',
48
        ]);
49
    }
50
}