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

Tag   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A scenarios() 0 9 1
A attributeLabels() 0 13 1
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
}