Completed
Push — master ( 0b55a4...076988 )
by Alexey
05:20
created

History::relations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 9
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 9
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
/**
4
 * Currency exchange rate history
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 Money\Currency\ExchangeRate;
13
14 View Code Duplication
class History extends \Model
15
{
16
    public static $cols = [
17
        'currency_exchangerate_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'rate'],
18
        'old' => ['type' => 'decimal'],
19
        'new' => ['type' => 'decimal'],
20
        'date_create' => ['type' => 'dateTime']
21
    ];
22
23
    public static function relations()
24
    {
25
        return [
26
            'rate' => [
27
                'model' => 'Money\Currency\ExchangeRate\History',
28
                'col' => 'currency_exchangerate_id'
29
            ],
30
        ];
31
    }
32
33
}
34