Commit 375172022c959f31ab3ed6dd54f5bbab167b78c3
1 parent
1f2f37e1
Blog article url
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
models/ArticleLang.php
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace artbox\weblog\models; | 3 | namespace artbox\weblog\models; |
| 4 | 4 | ||
| 5 | use artbox\core\behaviors\SlugBehavior; | 5 | use artbox\core\behaviors\SlugBehavior; |
| 6 | + use artbox\core\models\Alias; | ||
| 6 | use artbox\core\models\Language; | 7 | use artbox\core\models\Language; |
| 7 | use yii\db\ActiveRecord; | 8 | use yii\db\ActiveRecord; |
| 8 | 9 | ||
| @@ -149,4 +150,12 @@ | @@ -149,4 +150,12 @@ | ||
| 149 | { | 150 | { |
| 150 | return $this->hasOne(Language::className(), [ 'id' => 'language_id' ]); | 151 | return $this->hasOne(Language::className(), [ 'id' => 'language_id' ]); |
| 151 | } | 152 | } |
| 153 | + | ||
| 154 | + /** | ||
| 155 | + * @return \yii\db\ActiveQuery | ||
| 156 | + */ | ||
| 157 | + public function getAlias() | ||
| 158 | + { | ||
| 159 | + return $this->hasOne(Alias::className(), ['id' => 'alias_id']); | ||
| 160 | + } | ||
| 152 | } | 161 | } |