06ec2844
Administrator
28.03.16
|
1
|
<?php
|
eb7e82fb
Administrator
29.02.16
|
2
3
4
5
6
7
8
9
|
namespace common\models;
use Yii;
/**
* This is the model class for table "project_specialization".
*
|
06ec2844
Administrator
28.03.16
|
10
11
12
|
* @property integer $project_specialization_id
* @property integer $project_id
* @property integer $specialization_id
|
eb7e82fb
Administrator
29.02.16
|
13
|
*
|
06ec2844
Administrator
28.03.16
|
14
15
|
* @property Project $project
* @property Specialization $specialization
|
eb7e82fb
Administrator
29.02.16
|
16
|
*/
|
06ec2844
Administrator
28.03.16
|
17
|
class ProjectSpecialization extends \yii\db\ActiveRecord
|
eb7e82fb
Administrator
29.02.16
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'project_specialization';
}
/**
* @inheritdoc
*/
public function rules()
{
|
06ec2844
Administrator
28.03.16
|
32
33
34
35
|
return [
[['project_id', 'specialization_id'], 'integer'],
[['project_id'], 'exist', 'skipOnError' => true, 'targetClass' => Project::className(), 'targetAttribute' => ['project_id' => 'project_id']],
[['specialization_id'], 'exist', 'skipOnError' => true, 'targetClass' => Specialization::className(), 'targetAttribute' => ['specialization_id' => 'specialization_id']],
|
eb7e82fb
Administrator
29.02.16
|
36
37
38
39
40
41
42
43
44
|
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
|
06ec2844
Administrator
28.03.16
|
45
46
47
|
'project_specialization_id' => Yii::t('app', 'project_specialization_id'),
'project_id' => Yii::t('app', 'project_id'),
'specialization_id' => Yii::t('app', 'specialization_id'),
|
eb7e82fb
Administrator
29.02.16
|
48
49
50
51
52
53
54
55
|
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getProject()
{
|
06ec2844
Administrator
28.03.16
|
56
|
return $this->hasOne(Project::className(), ['project_id' => 'project_id']);
|
eb7e82fb
Administrator
29.02.16
|
57
58
59
60
61
62
63
|
}
/**
* @return \yii\db\ActiveQuery
*/
public function getSpecialization()
{
|
06ec2844
Administrator
28.03.16
|
64
|
return $this->hasOne(Specialization::className(), ['specialization_id' => 'specialization_id']);
|
eb7e82fb
Administrator
29.02.16
|
65
66
|
}
}
|