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

PriceSuggestionRequestForm   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 8 1
A attributeLabels() 0 8 1
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