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

ExchangeRate   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 4
dl 0
loc 34
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 4 1
A find() 0 4 1
A rules() 0 6 1
A attributeLabels() 0 8 1
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