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

Save::relations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 9
rs 9.6666
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
/**
4
 * Delivery user info save
5
 *
6
 * @author Alexey Krupskiy <[email protected]>
7
 * @link http://inji.ru/
8
 * @copyright 2016 Alexey Krupskiy
9
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
10
 */
11
12
namespace Ecommerce\Delivery;
13
14
class Save extends \Model
15
{
16
    public static $cols = [
17
        'name' => ['type' => 'text'],
18
        'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user']
19
    ];
20
21
    public static function relations()
22
    {
23
        return [
24
            'user' => [
25
                'model' => 'Users\User',
26
                'col' => 'user_id'
27
            ]
28
        ];
29
    }
30
31
}
32