-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsers.php
More file actions
executable file
·100 lines (93 loc) · 2.79 KB
/
Copy pathUsers.php
File metadata and controls
executable file
·100 lines (93 loc) · 2.79 KB
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
<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "users".
*
* @property string $id
* @property string $username
* @property string $password
* @property integer $active
* @property integer $person_id
* @property string $full_name
* @property string $create_by
* @property string $update_by
* @property string $date_created
* @property string $date_updated
* @property integer $profil
* @property integer $group_id
* @property integer $is_parent
* @property integer $user_id
* @property string $last_ip
* @property string $last_activity
*
* @property Profil $profil0
* @property Groups $group
*/
class Users extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'users';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['username', 'password', 'active', 'person_id', 'full_name', 'user_id', 'last_ip', 'last_activity'], 'required'],
[['active', 'person_id', 'profil', 'group_id', 'is_parent', 'user_id'], 'integer'],
[['date_created', 'date_updated', 'last_activity'], 'safe'],
[['username'], 'string', 'max' => 20],
[['password'], 'string', 'max' => 128],
[['full_name'], 'string', 'max' => 255],
[['create_by', 'update_by'], 'string', 'max' => 64],
[['last_ip'], 'string', 'max' => 100],
[['username'], 'unique'],
[['profil'], 'exist', 'skipOnError' => true, 'targetClass' => Profil::className(), 'targetAttribute' => ['profil' => 'id']],
[['group_id'], 'exist', 'skipOnError' => true, 'targetClass' => Groups::className(), 'targetAttribute' => ['group_id' => 'id']],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'username' => 'Username',
'password' => 'Password',
'active' => 'Active',
'person_id' => 'Person ID',
'full_name' => 'Full Name',
'create_by' => 'Create By',
'update_by' => 'Update By',
'date_created' => 'Date Created',
'date_updated' => 'Date Updated',
'profil' => 'Profil',
'group_id' => 'Group ID',
'is_parent' => 'Is Parent',
'user_id' => 'User ID',
'last_ip' => 'Last Ip',
'last_activity' => 'Last Activity',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getProfil0()
{
return $this->hasOne(Profil::className(), ['id' => 'profil']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getGroup()
{
return $this->hasOne(Groups::className(), ['id' => 'group_id']);
}
}