Completed
Push — master ( 267413...040341 )
by Dmitry
05:20
created

PriceSuggestionRequestForm::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace hipanel\modules\finance\models;
4
5
use Yii;
6
use yii\base\Model;
7
8
/**
9
 * Class PriceSuggestionRequestForm
10
 *
11
 * @author Dmytro Naumenko <[email protected]>
12
 */
13
class PriceSuggestionRequestForm extends Model
14
{
15
    public $plan_id;
16
17
    public $type;
18
19
    public $object_id;
20
21
    public function rules()
22
    {
23
        return [
24
            [['plan_id', 'object_id', 'type'], 'required'],
25
            [['plan_id', 'object_id'], 'integer'],
26
            [['type'], 'safe']
27
        ];
28
    }
29
30
    public function attributeLabels()
31
    {
32
        return [
33
            'plan_id' => Yii::t('hipanel.finance.price', 'Plan'),
34
            'type' => Yii::t('hipanel', 'Type'),
35
            'object_id' => Yii::t('hipanel', 'Object'),
36
        ];
37
    }
38
}
39