1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace app\core\models; |
4
|
|
|
|
5
|
|
|
use Yii; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* This is the model class for table "{{%currency_rate}}". |
9
|
|
|
* |
10
|
|
|
* @property int $id |
11
|
|
|
* @property int $user_id |
12
|
|
|
* @property string $currency_code |
13
|
|
|
* @property string $currency_name |
14
|
|
|
* @property int|null $rate |
15
|
|
|
* @property int|null $status |
16
|
|
|
* @property string|null $created_at |
17
|
|
|
* @property string|null $updated_at |
18
|
|
|
*/ |
19
|
|
|
class CurrencyRate extends \yii\db\ActiveRecord |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* {@inheritdoc} |
23
|
|
|
*/ |
24
|
|
|
public static function tableName() |
25
|
|
|
{ |
26
|
|
|
return '{{%currency_rate}}'; |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* {@inheritdoc} |
31
|
|
|
*/ |
32
|
|
|
public function rules() |
33
|
|
|
{ |
34
|
|
|
return [ |
35
|
|
|
[['user_id', 'currency_code', 'currency_name'], 'required'], |
36
|
|
|
[['user_id', 'rate', 'status'], 'integer'], |
37
|
|
|
[['created_at', 'updated_at'], 'safe'], |
38
|
|
|
[['currency_code'], 'string', 'max' => 3], |
39
|
|
|
[['currency_name'], 'string', 'max' => 60], |
40
|
|
|
]; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* {@inheritdoc} |
45
|
|
|
*/ |
46
|
|
|
public function attributeLabels() |
47
|
|
|
{ |
48
|
|
|
return [ |
49
|
|
|
'id' => Yii::t('app', 'ID'), |
50
|
|
|
'user_id' => Yii::t('app', 'User ID'), |
51
|
|
|
'currency_code' => Yii::t('app', 'Currency Code'), |
52
|
|
|
'currency_name' => Yii::t('app', 'Currency Name'), |
53
|
|
|
'rate' => Yii::t('app', 'Rate'), |
54
|
|
|
'status' => Yii::t('app', 'Status'), |
55
|
|
|
'created_at' => Yii::t('app', 'Created At'), |
56
|
|
|
'updated_at' => Yii::t('app', 'Updated At'), |
57
|
|
|
]; |
58
|
|
|
} |
59
|
|
|
} |
60
|
|
|
|