Test Failed
Push — master ( 23cc6e...476483 )
by Alexey
05:28
created

Item::name()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 3
Ratio 100 %

Importance

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