Commit b35485195d89ad71940c4d624971328d097935a7
1 parent
fa9a0922
Language links
Showing
1 changed file
with
10 additions
and
0 deletions
Show diff stats
behaviors/LanguageBehavior.php
@@ -279,4 +279,14 @@ | @@ -279,4 +279,14 @@ | ||
279 | { | 279 | { |
280 | return $this->transactionStatus; | 280 | return $this->transactionStatus; |
281 | } | 281 | } |
282 | + | ||
283 | + /** | ||
284 | + * @return \yii\db\ActiveQuery | ||
285 | + */ | ||
286 | + public function getLangInteractive() | ||
287 | + { | ||
288 | + $objectLang = $this->objectLang; | ||
289 | + $owner = $this->owner; | ||
290 | + return $owner->hasOne($objectLang::className(), [ $this->getLangKey() => $this->getOwnerKey() ]); | ||
291 | + } | ||
282 | } | 292 | } |
283 | \ No newline at end of file | 293 | \ No newline at end of file |