Completed
Push — master ( 678f4c...d13b92 )
by Andrii
10:30
created

AssignSwitchesForm   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 3 1
A tableName() 0 3 1
1
<?php
2
3
namespace hipanel\modules\server\forms;
4
5
use hipanel\base\ModelTrait;
6
use hipanel\modules\server\models\AssignSwitchInterface;
7
use hipanel\modules\server\models\Hub;
8
9
class AssignSwitchesForm extends Hub implements AssignSwitchInterface
10
{
11
    use ModelTrait;
12
13
    public $switchVariants = ['net', 'kvm', 'pdu', 'rack', 'console'];
14
15
    /**
16
     * @inheritdoc
17
     */
18
    public static function tableName()
19
    {
20
        return 'hub';
21
    }
22
23
    /**
24
     * @inheritdoc
25
     */
26
    public function rules()
27
    {
28
        return array_merge(parent::rules(), $this->defaultSwitchRules(), $this->generateUniqueValidators());
29
    }
30
}
31