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