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

AssignSwitchesForm::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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