Blame view

common/modules/comment/models/Rating.php 1.21 KB
2d107e9e   Yarik   test
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
  <?php
  
  namespace common\modules\comment\models;
  
  use Yii;
  
  /**
   * This is the model class for table "rating".
   *
   * @property integer $rating_id
   * @property string $date_add
   * @property string $date_update
   * @property integer $user_id
   * @property string $entity
   * @property integer $value
   *
   * @property \common\models\User $user
   */
  class Rating extends \yii\db\ActiveRecord
  {
      /**
       * @inheritdoc
       */
      public static function tableName()
      {
          return 'rating';
      }
  
      /**
       * @inheritdoc
       */
      public function rules()
      {
          return [
              [['value'], 'integer'],
          ];
      }
  
      /**
       * @inheritdoc
       */
      public function attributeLabels()
      {
          return [
              'rating_id' => Yii::t('app', 'Rating ID'),
              'date_add' => Yii::t('app', 'Date Add'),
              'date_update' => Yii::t('app', 'Date Update'),
              'user_id' => Yii::t('app', 'User ID'),
              'entity' => Yii::t('app', 'Entity'),
              'value' => Yii::t('app', 'Value'),
          ];
      }
  
      /**
       * @return \yii\db\ActiveQuery
       */
      public function getUser()
      {
          return $this->hasOne(\common\models\User::className(), ['id' => 'user_id']);
      }
  }