Commit 420d8fd52ac4482d9e0c22e636298b7ce430bfe1
1 parent
048403a6
-Sitemap need to test
Showing
2 changed files
with
12 additions
and
0 deletions
Show diff stats
models/CategoryLang.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 yii\db\ActiveRecord; | 7 | use yii\db\ActiveRecord; |
| 7 | use artbox\core\models\Language; | 8 | use artbox\core\models\Language; |
| 8 | 9 | ||
| @@ -131,6 +132,11 @@ | @@ -131,6 +132,11 @@ | ||
| 131 | return $this->hasOne(Category::className(), [ 'id' => 'blog_category_id' ]); | 132 | return $this->hasOne(Category::className(), [ 'id' => 'blog_category_id' ]); |
| 132 | } | 133 | } |
| 133 | 134 | ||
| 135 | + public function getAlias() | ||
| 136 | + { | ||
| 137 | + return $this->hasOne(Alias::className(), [ 'id' => 'alias_id' ]); | ||
| 138 | + } | ||
| 139 | + | ||
| 134 | /** | 140 | /** |
| 135 | * @return \yii\db\ActiveQuery | 141 | * @return \yii\db\ActiveQuery |
| 136 | */ | 142 | */ |
models/TagLang.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 | ||
| @@ -122,6 +123,11 @@ | @@ -122,6 +123,11 @@ | ||
| 122 | return $this->hasOne(Tag::className(), [ 'id' => 'blog_tag_id' ]); | 123 | return $this->hasOne(Tag::className(), [ 'id' => 'blog_tag_id' ]); |
| 123 | } | 124 | } |
| 124 | 125 | ||
| 126 | + public function getAlias() | ||
| 127 | + { | ||
| 128 | + return $this->hasOne(Alias::className(), [ 'id' => 'alias_id' ]); | ||
| 129 | + } | ||
| 130 | + | ||
| 125 | /** | 131 | /** |
| 126 | * @return \yii\db\ActiveQuery | 132 | * @return \yii\db\ActiveQuery |
| 127 | */ | 133 | */ |