Blame view

common/models/Employment.php 1 KB
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 "employment".

   *

06ec2844   Administrator   28.03.16
10
11
   * @property integer $employment_id

   * @property string $name

eb7e82fb   Administrator   29.02.16
12
   *

06ec2844   Administrator   28.03.16
13
   * @property VacancyEmployment[] $vacancyEmployments

eb7e82fb   Administrator   29.02.16
14
   */

06ec2844   Administrator   28.03.16
15
  class Employment extends \yii\db\ActiveRecord

eb7e82fb   Administrator   29.02.16
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  {

      /**

       * @inheritdoc

       */

      public static function tableName()

      {

          return 'employment';

      }

  

      /**

       * @inheritdoc

       */

      public function rules()

      {

06ec2844   Administrator   28.03.16
30
31
          return [

              [['name'], 'string', 'max' => 255],

eb7e82fb   Administrator   29.02.16
32
33
34
35
36
37
38
39
40
          ];

      }

  

      /**

       * @inheritdoc

       */

      public function attributeLabels()

      {

          return [

06ec2844   Administrator   28.03.16
41
42
              'employment_id' => Yii::t('app', 'employment_id'),

              'name' => Yii::t('app', 'name'),

eb7e82fb   Administrator   29.02.16
43
44
45
46
47
48
49
50
          ];

      }

  

      /**

       * @return \yii\db\ActiveQuery

       */

      public function getVacancyEmployments()

      {

06ec2844   Administrator   28.03.16
51
          return $this->hasMany(VacancyEmployment::className(), ['employment_id' => 'employment_id']);

eb7e82fb   Administrator   29.02.16
52
53
      }

  }