Total Complexity | 3 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
8 | class HubCombo extends Combo |
||
9 | { |
||
10 | const IPMI = 'net'; |
||
11 | const KVM = 'kvm'; |
||
12 | const NET = 'net'; |
||
13 | const PDU = 'pdu'; |
||
14 | const RACK = 'rack'; |
||
15 | |||
16 | /** {@inheritdoc} */ |
||
17 | public $name = 'name'; |
||
18 | |||
19 | /** {@inheritdoc} */ |
||
20 | public $type = 'server/hub'; |
||
21 | |||
22 | /** {@inheritdoc} */ |
||
23 | public $url = '/server/hub/index'; |
||
24 | |||
25 | /** {@inheritdoc} */ |
||
26 | public $_return = ['id']; |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | public $primaryFilter = 'name_ilike'; |
||
32 | |||
33 | /** {@inheritdoc} */ |
||
34 | public $_rename = ['text' => 'name']; |
||
35 | |||
36 | public $hubType; |
||
37 | |||
38 | /** {@inheritdoc} */ |
||
39 | public function getFilter() |
||
40 | { |
||
41 | if ($this->hubType) { |
||
42 | return ArrayHelper::merge(parent::getFilter(), [ |
||
43 | 'type' => ['format' => $this->getHubType()], |
||
44 | 'limit' => ['format' => '50'], |
||
45 | ]); |
||
46 | } |
||
47 | |||
48 | return parent::getFilter(); |
||
49 | } |
||
50 | |||
51 | private function getHubType() |
||
54 | } |
||
55 | } |
||
57 |