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

AssignHubsForm::batchQuery()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 3
crap 6
1
<?php
2
3
namespace hipanel\modules\server\forms;
4
5
use hipanel\base\ModelTrait;
6
use hipanel\modules\server\models\Server;
7
use Yii;
8
9
/**
10
 * Class AssignHubsForm
11
 */
12
class AssignHubsForm extends Server
13
{
14
    use ModelTrait;
15
16
    /**
17
     * @var array
18
     */
19
    public $switchVariants = ['net', 'kvm', 'pdu', 'rack', 'pdu2', 'nic2', 'ipmi'];
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public static function tableName()
25
    {
26
        return 'server';
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function rules()
33
    {
34
        return array_merge(parent::rules(), $this->defaultSwitchRules(), $this->generateUniqueValidators());
35
    }
36
37
    public function attributeLabels()
38
    {
39
        return array_merge(parent::attributeLabels(), [
40
            'pdu2' => Yii::t('hipanel:server', 'APC 2'),
41
            'nic2' => Yii::t('hipanel:server', 'Switch 2'),
42
        ]);
43
    }
44
}
45
46