Advertisement
alpa_s

Untitled

Nov 20th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1.     protected function createFallbackQuery($category, $language, $fallbackLanguage)
  2.     {
  3.         return (new Query())->select(['message' => 't1.message', 'translation' => 't2.translation'])
  4.             ->from(['t1' => $this->sourceMessageTable, 't2' => $this->messageTable])
  5.             ->where([
  6.                 't1.id' => new Expression('[[t2.id]]'),
  7.                 't1.category' => $category,
  8.                 't2.language' => $fallbackLanguage,
  9.             ])->andWhere([
  10.                 'NOT IN', 't2.id', (new Query())->select('[[id]]')->from($this->messageTable)->where(['language' => $language])
  11.             ]);
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement