Account::getAccountStats()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
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 Account extends \app\models\Account
14
{
15
    const SCENARIO_UPDATE = 'update';
16
17
    public $s_categories;
18
19
    public function scenarios()
20
    {
21
        $scenarios = parent::scenarios();
22
        $scenarios[self::SCENARIO_UPDATE] = [
23
            'name',
24
            'is_valid',
25
        ];
26
27
        return $scenarios;
28
    }
29
30
    public function attributeLabels()
31
    {
32
        return ArrayHelper::merge(parent::attributeLabels(), [
33
            's_categories' => 'Categories',
34
            'is_valid' => 'Is Valid - an exclamation triangle in the list of accounts, is set automatically if the account is not reachable. Check this option if you are sure that this account is valid and want to try to refresh stats again.',
35
        ]);
36
    }
37
38
    public function getAccountStats()
39
    {
40
        return $this->hasMany(AccountStats::class, ['account_id' => 'id']);
41
    }
42
}