1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Hosting Plugin for HiPanel |
4
|
|
|
* |
5
|
|
|
* @link https://github.com/hiqdev/hipanel-module-hosting |
6
|
|
|
* @package hipanel-module-hosting |
7
|
|
|
* @license BSD-3-Clause |
8
|
|
|
* @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/) |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace hipanel\modules\hosting\models; |
12
|
|
|
|
13
|
|
|
use hipanel\base\Model; |
14
|
|
|
use hipanel\base\ModelTrait; |
15
|
|
|
use Yii; |
16
|
|
|
|
17
|
|
|
class Aggregate extends Model |
18
|
|
|
{ |
19
|
|
|
use ModelTrait; |
20
|
|
|
|
21
|
|
|
/** {@inheritdoc} */ |
22
|
|
|
public function rules() |
23
|
|
|
{ |
24
|
|
|
return array_merge(parent::rules(), [ |
25
|
|
|
[['id', 'client_id', 'seller_id'], 'integer'], |
26
|
|
|
[['note', 'rir', 'state', 'type', 'client', 'seller'], 'string'], |
27
|
|
|
[['ip'], 'ip', 'subnet' => null], |
28
|
|
|
|
29
|
|
|
[['ip', 'rir'], 'required', 'on' => ['create', 'update']], |
30
|
|
|
[['id'], 'required', 'on' => ['update']], |
31
|
|
|
]); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** {@inheritdoc} */ |
35
|
|
|
public function attributeLabels() |
36
|
|
|
{ |
37
|
|
|
return $this->mergeAttributeLabels([ |
38
|
|
|
'ip' => Yii::t('hipanel.hosting.ipam', 'Prefix'), |
39
|
|
|
'rir' => Yii::t('hipanel.hosting.ipam', 'RIR'), |
40
|
|
|
'note' => Yii::t('hipanel.hosting.ipam', 'Description'), |
41
|
|
|
]); |
42
|
|
|
} |
43
|
|
|
} |
44
|
|
|
|