forked from sangkil/sangkilbiz3
/
Price.php
101 lines (92 loc) · 2.29 KB
/
Price.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
namespace biz\master\models;
use Yii;
/**
* This is the model class for table "price".
*
* @property integer $id_product
* @property integer $id_price_category
* @property integer $id_uom
* @property string $price
* @property string $create_at
* @property integer $create_by
* @property string $update_at
* @property integer $update_by
*
* @property PriceCategory $idPriceCategory
* @property Uom $idUom
* @property Product $idProduct
*/
class Price extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%price}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_product', 'id_price_category', 'id_uom', 'price'], 'required'],
[['id_product', 'id_price_category', 'id_uom'], 'integer'],
[['price'], 'double']
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id_product' => 'Id Product',
'id_price_category' => 'Id Price Category',
'id_uom' => 'Id Uom',
'price' => 'Price',
'create_at' => 'Create At',
'create_by' => 'Create By',
'update_at' => 'Update At',
'update_by' => 'Update By',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getIdPriceCategory()
{
return $this->hasOne(PriceCategory::className(), ['id_price_category' => 'id_price_category']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getIdUom()
{
return $this->hasOne(Uom::className(), ['id_uom' => 'id_uom']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getIdProduct()
{
return $this->hasOne(Product::className(), ['id_product' => 'id_product']);
}
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'BizTimestampBehavior',
'BizBlameableBehavior',
[
'class'=>'mdm\logger\RecordLogger',
'name'=>'log_price',
'attributes'=>['log_by','log_time1','log_time2','id_product','id_price_category', 'id_uom','price','app','id_ref']
],
];
}
}