Blame view

common/models/ProjectSpecialization.php 1.73 KB
84ebac3d   Yarik   test
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".

   *

84ebac3d   Yarik   test
10
11
12
   * @property integer $project_specialization_id
   * @property integer $project_id
   * @property integer $specialization_id
eb7e82fb   Administrator   29.02.16
13
   *

84ebac3d   Yarik   test
14
15
   * @property Project $project
   * @property Specialization $specialization
eb7e82fb   Administrator   29.02.16
16
   */

84ebac3d   Yarik   test
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()

      {

84ebac3d   Yarik   test
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 [

84ebac3d   Yarik   test
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()

      {

84ebac3d   Yarik   test
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()

      {

84ebac3d   Yarik   test
64
          return $this->hasOne(Specialization::className(), ['specialization_id' => 'specialization_id']);
eb7e82fb   Administrator   29.02.16
65
66
      }

  }