-
Notifications
You must be signed in to change notification settings - Fork 0
/
Donate.php
executable file
·102 lines (90 loc) · 2.08 KB
/
Donate.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
102
<?php
namespace app\models;
use app\models\behaviors\TimestampBehavior;
use app\models\behaviors\TimestampConvertBehavior;
use app\models\query\DonateQuery;
/**
* This is the model class for table "donate".
*
* @property integer $id
* @property integer $partner_id
* @property integer $user_id
* @property string $sum
* @property integer $timestamp
* @property integer $created_at
* @property integer $updated_at
* @property string $notes
*
* @property Partner $partner
* @property User $user
*/
class Donate extends AbstractModel
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'donate';
}
/**
* @inheritdoc
*/
public function behaviors()
{
return [
TimestampBehavior::class,
TimestampConvertBehavior::class,
];
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['partner_id', 'sum', 'timestamp'], 'required'],
[['partner_id', 'user_id'], 'integer'],
[['sum'], 'number'],
[['notes'], 'string']
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return array_merge(parent::attributeLabels(), [
'id' => __('ID'),
'partner_id' => __('Partner'),
'partner' => __('Partner'),
'user_id' => __('User'),
'user' => __('User'),
'sum' => __('Sum'),
'timestamp' => __('Date'),
'notes' => __('Notes'),
]);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getPartner()
{
return $this->hasOne(Partner::className(), ['id' => 'partner_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getUser()
{
return $this->hasOne(User::className(), ['id' => 'user_id']);
}
/**
* @inheritdoc
* @return DonateQuery the active query used by this AR class.
*/
public static function find()
{
return new DonateQuery(get_called_class());
}
}