Passed
Push — master ( 232b03...071d97 )
by Alexey
04:56
created

Badge::relations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * To change this license header, choose License Headers in Project Properties.
5
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7
 */
8
9
namespace Ecommerce\Item;
10
11
/**
12
 * Description of Badge
13
 *
14
 * @author benzu
15
 */
16
class Badge extends \Model {
17
18
    public static $cols = [
19
        'name' => ['type' => 'text'],
20
        'image_file_id' => ['type' => 'image'],
21
    ];
22
    public static $forms = [
23
        'manager' => [
24
            'map' => [
25
                ['name', 'image_file_id']
26
            ]
27
        ]
28
    ];
29
    public static $labels = [
30
        'name' => 'Название',
31
        'image_file_id' => 'Изображение бейджа'
32
    ];
33
    public static $dataManagers = [
34
        'manager' => [
35
            'cols' => ['name', 'image_file_id']
36
        ]
37
    ];
38
39
    public static function relations() {
40
        return [
41
            'image' => [
42
                'model' => 'Files\File',
43
                'col' => 'image_file_id'
44
            ]
45
        ];
46
    }
47
}