Completed
Push — master ( 93368f...faf894 )
by Alexey
05:23
created

ConditionRewardLnk::relations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
/**
4
 * Reward conditions relations
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 Money\Reward;
13
14
class ConditionRewardLnk extends \Model
15
{
16
    public static $cols = [
17
        'reward_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'reward'],
18
        'reward_condition_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'condition'],
19
    ];
20
    public static $dataManagers = [
21
        'manager' => [
22
            'cols' => ['reward_id', 'reward_condition_id']
23
        ]
24
    ];
25
    public static $forms = [
26
        'manager'=>[
27
            'map'=>[
28
                ['reward_id', 'reward_condition_id']
29
            ]
30
        ]
31
    ];
32
33
    public static function relations()
34
    {
35
        return [
36
            'reward' => [
37
                'model' => 'Money\Reward',
38
                'col' => 'reward_id'
39
            ],
40
            'condition' => [
41
                'model' => 'Money\Reward\Condition',
42
                'col' => 'reward_condition_id'
43
            ],
44
        ];
45
    }
46
47
}
48