Completed
Push — master ( 3bd96a...d26825 )
by Klochok
12:58
created

Address   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 4 1
A rules() 0 4 1
A attributeLabels() 0 6 1
A find() 0 6 1
1
<?php
2
3
namespace hipanel\modules\hosting\models;
4
5
use hipanel\base\ModelTrait;
6
use hipanel\modules\hosting\models\query\AddressQuery;
7
use hipanel\modules\hosting\models\query\PrefixQuery;
8
use Yii;
9
use yii\db\QueryInterface;
10
11
class Address extends Prefix
12
{
13
    use ModelTrait;
14
15
    public static function tableName()
16
    {
17
        return 'prefix';
18
    }
19
20
    /** {@inheritdoc} */
21
    public function rules()
22
    {
23
        return parent::rules();
24
    }
25
26
    /** {@inheritdoc} */
27
    public function attributeLabels()
28
    {
29
        return array_merge(parent::attributeLabels(), [
30
            'ip' => Yii::t('hipanel.hosting.ipam', 'Address'),
31
        ]);
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     * @return PrefixQuery
37
     */
38
    public static function find(array $options = []): QueryInterface
39
    {
40
        return new AddressQuery(get_called_class(), [
41
            'options' => $options,
42
        ]);
43
    }
44
}
45