Completed
Push — master ( 27c584...7678fd )
by Andrii
13:30
created

SaleCreateCommand::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 12
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace hiqdev\billing\hiapi\sale\Create;
4
5
use hiapi\commands\BaseCommand;
6
use hiapi\validators\IdValidator;
7
8
class SaleCreateCommand extends BaseCommand
9
{
10
    public $customer_id;
11
12
    public $plan_id;
13
14
    public $target_id;
15
16
    public $time;
17
18
    public $customer;
19
20
    public $plan;
21
22
    public $target;
23
24
    public function rules()
25
    {
26
        return [
27
            [['customer_id'], IdValidator::class],
28
29
            [['plan_id'], IdValidator::class],
30
            [['plan_id'], 'required'],
31
32
            [['target_id'], IdValidator::class],
33
            [['target_id'], 'required'],
34
35
            [['time'], 'datetime'],
36
        ];
37
    }
38
}
39