ArticleLang.php
2.15 KB
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 $article_language_id
* @property integer $language_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_keyword
* @property string $h1_tag
* @property string $tag
*
* @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 [
[['language_id', 'text', 'name'], 'required'],
[['language_id', 'article_id'], 'integer'],
[['text', 'seo_url', 'name', 'preview', 'meta_title', 'meta_descr', 'meta_keyword', 'h1_tag', 'tag'], 'string']
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'article_language_id' => Yii::t('app', 'ID'),
'language_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_keyword' => Yii::t('app', 'Meta Keywords'),
'h1_tag' => Yii::t('app', 'H1 Tag'),
'tag' => Yii::t('app', 'Tags'),
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getArticle()
{
return $this->hasOne(Article::className(), ['article_id' => 'article_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getLang()
{
return $this->hasOne(Language::className(), ['language_id' => 'language_id']);
}
}