Blame view

common/models/SeoDynamic.php 2.12 KB
4253cbec   root   first commit
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
  <?php
  
  namespace common\models;
  
  use Yii;
  
  /**
   * This is the model class for table "seo_dynamic".
   *
   * @property integer $seo_dynamic_id
   * @property integer $seo_category_id
   * @property string $name
   * @property string $action
   * @property string $fields
   * @property string $title
   * @property string $h1
   * @property string $description
   * @property string $seo_text
   * @property integer $status
   * @property string $param
   * @property string $key
   *
   * @property SeoCategory $seoCategory
   */
  class SeoDynamic extends \yii\db\ActiveRecord
  {
      /**
       * @inheritdoc
       */
      public static function tableName()
      {
          return 'seo_dynamic';
      }
  
      /**
       * @inheritdoc
       */
      public function rules()
      {
          return [
              [['seo_category_id', 'status'], 'integer'],
              [['seo_text'], 'string'],
              [['name', 'action'], 'string', 'max' => 200],
              [['fields', 'title', 'meta', 'h1', 'description', 'param', 'key'], 'string', 'max' => 255],
              [['seo_category_id'], 'exist', 'skipOnError' => true, 'targetClass' => SeoCategory::className(), 'targetAttribute' => ['seo_category_id' => 'seo_category_id']],
          ];
      }
  
      /**
       * @inheritdoc
       */
      public function attributeLabels()
      {
          return [
              'seo_dynamic_id' => Yii::t('app', 'seo_dynamic_id'),
              'seo_category_id' => Yii::t('app', 'seo_category_id'),
              'name' => Yii::t('app', 'name'),
              'action' => Yii::t('app', 'action'),
              'fields' => Yii::t('app', 'fields'),
              'title' => Yii::t('app', 'title'),
              'meta' => Yii::t('app', 'meta'),
              'h1' => Yii::t('app', 'h1'),
              'description' => Yii::t('app', 'description'),
              'seo_text' => Yii::t('app', 'seo_text'),
              'status' => Yii::t('app', 'status'),
              'param' => Yii::t('app', 'param'),
              'key' => Yii::t('app', 'key'),
          ];
      }
  
      /**
       * @return \yii\db\ActiveQuery
       */
      public function getSeoCategory()
      {
          return $this->hasOne(SeoCategory::className(), ['seo_category_id' => 'seo_category_id']);
      }
  }