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