Blame view

common/modules/blog/models/ArticleLang.php 2.09 KB
777eb8ff   Yarik   Добален блог v 0....
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
79
80
81
82
83
84
85
  <?php
  
  namespace common\modules\blog\models;
  
  use Yii;
  use common\models\Language;
  
  /**
   * This is the model class for table "article_lang".
   *
   * @property integer $id
   * @property integer $lang_id
   * @property integer $article_id
   * @property string $text
   * @property string $seo_url
   * @property string $name
   * @property string $preview
   * @property string $meta_title
   * @property string $meta_descr
   * @property string $meta_keywords
   * @property string $h1_tag
   * @property string $tags
   *
   * @property Article $article
   * @property Language $lang
   */
  class ArticleLang extends \yii\db\ActiveRecord
  {
      /**
       * @inheritdoc
       */
      public static function tableName()
      {
          return 'article_lang';
      }
  
      /**
       * @inheritdoc
       */
      public function rules()
      {
          return [
              [['lang_id', 'text', 'name'], 'required'],
              [['lang_id', 'article_id'], 'integer'],
              [['text', 'seo_url', 'name', 'preview', 'meta_title', 'meta_descr', 'meta_keywords', 'h1_tag', 'tags'], 'string']
          ];
      }
  
      /**
       * @inheritdoc
       */
      public function attributeLabels()
      {
          return [
              'id' => Yii::t('app', 'ID'),
              'lang_id' => Yii::t('app', 'Lang ID'),
              'article_id' => Yii::t('app', 'Article ID'),
              'text' => Yii::t('app', 'Text'),
              'seo_url' => Yii::t('app', 'Seo Url'),
              'name' => Yii::t('app', 'Name'),
              'preview' => Yii::t('app', 'Preview'),
              'meta_title' => Yii::t('app', 'Meta Title'),
              'meta_descr' => Yii::t('app', 'Meta Descr'),
              'meta_keywords' => Yii::t('app', 'Meta Keywords'),
              'h1_tag' => Yii::t('app', 'H1 Tag'),
              'tags' => Yii::t('app', 'Tags'),
          ];
      }
  
      /**
       * @return \yii\db\ActiveQuery
       */
      public function getArticle()
      {
          return $this->hasOne(Article::className(), ['id' => 'article_id']);
      }
  
      /**
       * @return \yii\db\ActiveQuery
       */
      public function getLang()
      {
          return $this->hasOne(Language::className(), ['language_id' => 'lang_id']);
      }
  }