Team.php
3.88 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
namespace backend\models;
use Yii;
use backend\models\TeamSkils;
/**
* This is the model class for table "team".
*
* @property integer $id
* @property integer $department_id
* @property integer $user_id
* @property string $name
* @property string $name2
* @property string $email
* @property string $job
* @property string $zodiac
* @property integer $iq
* @property string $soc_vk
* @property string $soc_fb
* @property string $soc_tw
* @property string $soc_li
* @property string $interests_caption
* @property string $skils_caption
* @property string $books_caption
* @property string $films_caption
* @property string $description
* @property string $photo
* @property string $photo_big
* @property integer $visible
*
* @property Departments $department
* @property TeamFilms[] $teamFilms
* @property TeamHumors[] $teamHumors
* @property TeamInterests[] $teamInterests
* @property TeamSkils[] $teamSkils
*/
class Team extends \yii\db\ActiveRecord
{
public $file;
public $file2;
/**
* @inheritdoc
*/
public static function tableName()
{
return 'team';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['department_id', 'name', 'name2', 'job'], 'required'],
[['department_id', 'user_id', 'iq', 'visible'], 'integer'],
[['zodiac', 'interests_caption', 'skils_caption', 'books_caption', 'films_caption', 'description'], 'string'],
[['name', 'name2', 'job'], 'string', 'max' => 150],
[['file', 'file2'], 'file'],
[['email', 'soc_vk', 'soc_fb', 'soc_tw', 'soc_li'], 'string', 'max' => 255]
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => Yii::t('app', 'ID'),
'department_id' => Yii::t('app', 'Department ID'),
'user_id' => Yii::t('app', 'User ID'),
'name' => Yii::t('app', 'Name'),
'name2' => Yii::t('app', 'Name2'),
'email' => Yii::t('app', 'Email'),
'job' => Yii::t('app', 'Job'),
'zodiac' => Yii::t('app', 'Zodiac'),
'iq' => Yii::t('app', 'Iq'),
'soc_vk' => Yii::t('app', 'Soc Vk'),
'soc_fb' => Yii::t('app', 'Soc Fb'),
'soc_tw' => Yii::t('app', 'Soc Tw'),
'soc_li' => Yii::t('app', 'Soc Li'),
'interests_caption' => Yii::t('app', 'Interests Caption'),
'skils_caption' => Yii::t('app', 'Skils Caption'),
'books_caption' => Yii::t('app', 'Books Caption'),
'films_caption' => Yii::t('app', 'Films Caption'),
'description' => Yii::t('app', 'Description'),
'file' => Yii::t('app', 'Photo'),
'file2' => Yii::t('app', 'Photo Big'),
'visible' => Yii::t('app', 'Visible'),
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getDepartment()
{
return $this->hasOne(Departments::className(), ['id' => 'department_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getTeamFilms()
{
return $this->hasMany(TeamFilms::className(), ['team_id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getTeamHumors()
{
return $this->hasMany(TeamHumors::className(), ['team_id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getTeamInterests()
{
return $this->hasMany(TeamInterests::className(), ['team_id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getTeamSkils()
{
return $this->hasMany(TeamSkils::className(), ['team_id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
// public function getUser()
// {
// return $this->hasMany(UserSkils::className(), ['user_id' => 'id']);
// }
}