Commit 25f1083d by Alexander Makarov

Merge pull request #3769 from creocoder/db-message-source-code-style-fix

\yii\i18n\DbMessageSource code style fixes
parents efda450a 333f521f
...@@ -141,7 +141,7 @@ class DbMessageSource extends MessageSource ...@@ -141,7 +141,7 @@ class DbMessageSource extends MessageSource
{ {
$mainQuery = new Query(); $mainQuery = new Query();
$mainQuery->select(['t1.message message', 't2.translation translation']) $mainQuery->select(['t1.message message', 't2.translation translation'])
->from([$this->sourceMessageTable . ' t1', $this->messageTable . ' t2']) ->from(["$this->sourceMessageTable t1", "$this->messageTable t2"])
->where('t1.id = t2.id AND t1.category = :category AND t2.language = :language') ->where('t1.id = t2.id AND t1.category = :category AND t2.language = :language')
->params([':category' => $category, ':language' => $language]); ->params([':category' => $category, ':language' => $language]);
...@@ -149,9 +149,9 @@ class DbMessageSource extends MessageSource ...@@ -149,9 +149,9 @@ class DbMessageSource extends MessageSource
if ($fallbackLanguage != $language) { if ($fallbackLanguage != $language) {
$fallbackQuery = new Query(); $fallbackQuery = new Query();
$fallbackQuery->select(['t1.message message', 't2.translation translation']) $fallbackQuery->select(['t1.message message', 't2.translation translation'])
->from([$this->sourceMessageTable . ' t1', $this->messageTable . ' t2']) ->from(["$this->sourceMessageTable t1", "$this->messageTable t2"])
->where('t1.id = t2.id AND t1.category = :category AND t2.language = :fallbackLanguage') ->where('t1.id = t2.id AND t1.category = :category AND t2.language = :fallbackLanguage')
->andWhere('t2.id NOT IN (SELECT id FROM '.$this->messageTable.' WHERE language = :language)') ->andWhere("t2.id NOT IN (SELECT id FROM $this->messageTable WHERE language = :language)")
->params([':category' => $category, ':language' => $language, ':fallbackLanguage' => $fallbackLanguage]); ->params([':category' => $category, ':language' => $language, ':fallbackLanguage' => $fallbackLanguage]);
$mainQuery->union($fallbackQuery, true); $mainQuery->union($fallbackQuery, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment