Total Complexity | 4 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | class MonitoringForm extends Model |
||
16 | { |
||
17 | public $names; |
||
18 | public $categories; |
||
19 | |||
20 | public function rules() |
||
25 | ]; |
||
26 | } |
||
27 | |||
28 | public function scenarios() |
||
29 | { |
||
30 | return [ |
||
31 | TrackerType::ACCOUNT => [ |
||
32 | 'names', |
||
33 | 'categories' |
||
34 | ], |
||
35 | TrackerType::TAG => [ |
||
36 | 'names', |
||
37 | ], |
||
38 | ]; |
||
39 | } |
||
40 | |||
41 | public function attributeLabels() |
||
42 | { |
||
43 | $labels = parent::attributeLabels(); |
||
44 | $trackerTypeLabels = [ |
||
45 | TrackerType::ACCOUNT => [ |
||
46 | 'names' => 'Accounts', |
||
47 | ], |
||
48 | TrackerType::TAG => [ |
||
49 | 'names' => 'Tags', |
||
50 | ], |
||
51 | ]; |
||
52 | |||
53 | return ArrayHelper::merge($labels, ArrayHelper::getValue($trackerTypeLabels, $this->scenario, [])); |
||
54 | } |
||
55 | |||
56 | public function attributeHints() |
||
67 | } |
||
68 | } |