Completed
Push — master ( 22f267...fde715 )
by Klochok
23:32 queued 08:43
created

SoftwareSettings   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 30
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 4 1
A primaryKey() 0 4 1
A scenarioActions() 0 6 1
A rules() 0 8 1
1
<?php
2
3
namespace hipanel\modules\server\models;
4
5
class SoftwareSettings extends \hipanel\base\Model
6
{
7
    const SCENARIO_DEFAULT = 'dumb';
8
9
    public static function tableName()
10
    {
11
        return 'server';
12
    }
13
14
    public static function primaryKey()
15
    {
16
        return ['id'];
17
    }
18
19
    public function scenarioActions()
20
    {
21
        return [
22
            'default' => 'set-software-settings'
23
        ];
24
    }
25
26
    public function rules()
27
    {
28
        return [
29
            [['id'], 'integer'],
30
            [['virtual_switch', 'ignore_ip_mon'], 'boolean'],
31
            [['os', 'version', 'ip_mon_comment', 'bw_limit', 'bw_group', 'failure_contacts', 'info'], 'string'],
32
        ];
33
    }
34
}
35