Completed
Push — master ( 76d596...34b53d )
by Dmitry
04:27
created

ExchangeRate::find()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace hipanel\modules\finance\models;
4
5
use hipanel\base\ModelTrait;
6
use hiqdev\hiart\ActiveQuery;
7
use hiqdev\hiart\ActiveRecord;
8
9
class ExchangeRate extends ActiveRecord
10
{
11
    use ModelTrait;
12
13
    public static function tableName()
14
    {
15
        return 'currency';
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     * @return ActiveQuery
21
     */
22
    public static function find()
23
    {
24
        return parent::find()->action('search-rates');
25
    }
26
27
    public function rules()
28
    {
29
        return [
30
            [['from', 'to', 'rate'], 'safe']
31
        ];
32
    }
33
34
    public function attributeLabels()
35
    {
36
        return [
37
            'from' => \Yii::t('hipanel:finance', 'From'),
38
            'to' => \Yii::t('hipanel:finance', 'To'),
39
            'rate' => \Yii::t('hipanel:finance', 'Rate')
40
        ];
41
    }
42
}
43