Completed
Push — master ( 51e7b9...4b0341 )
by Alexey
05:48
created

Value::relations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 13
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 13
loc 13
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
/**
4
 * Delivery user info
5
 * @author Alexey Krupskiy <[email protected]>
6
 * @link http://inji.ru/
7
 * @copyright 2016 Alexey Krupskiy
8
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
9
 */
10
11
namespace Ecommerce\Delivery;
12
13 View Code Duplication
class Value extends \Model
14
{
15
    public static $cols = [
16
        //Основные параметры
17
        'delivery_save_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'save'],
18
        'delivery_field_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'field'],
19
        'value' => ['type' => 'text'],
20
        //Системные
21
        'date_create' => ['type' => 'dateTime'],
22
    ];
23
    public static $forms = [
24
        'manager' => [
25
            'map' => [
26
                ['cart_id', 'delivery_field_id', 'value']
27
            ]
28
        ]
29
    ];
30
    public static $dataManagers = [
31
        'manager' => [
32
            'cols' => [
33
                'cart_id',
34
                'delivery_field_id',
35
                'value'
36
            ]
37
        ]
38
    ];
39
40
    public static function relations()
41
    {
42
        return [
43
            'field' => [
44
                'model' => 'Ecommerce\Delivery\Field',
45
                'col' => 'useradds_field_id'
46
            ],
47
            'save' => [
48
                'model' => 'Ecommerce\Delivery\Save',
49
                'col' => 'cart_id'
50
            ],
51
        ];
52
    }
53
54
}
55