Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
OmgDef committed Oct 7, 2014
1 parent ec5e1f4 commit 8485c3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MultilingualBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function getTranslation($language = null)
{
$language = $language ? $language : $this->_currentLanguage;
return $this->owner->hasMany($this->langClassName, [$this->langForeignKey => $this->_ownerPrimaryKey])
->where($this->languageField . '=:language', [':language' => $language]);
->where([$this->languageField => $language]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion MultilingualTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function localized($language = null)
$language = Yii::$app->language;

$this->with(['translation' => function ($query) use ($language) {
$query->andWhere($this->languageField . '=:language', [':language' => substr($language, 0, 2)]);
$query->andWhere([$this->languageField => substr($language, 0, 2)]);
}]);
return $this;
}
Expand Down

0 comments on commit 8485c3e

Please sign in to comment.