You are here

public function MenuTranslation::query in Drupal 9

Return value

\Drupal\Core\Database\Query\SelectInterface

Overrides Menu::query

File

core/modules/system/src/Plugin/migrate/source/d7/MenuTranslation.php, line 25

Class

MenuTranslation
Drupal 7 i18n menu translation source from database.

Namespace

Drupal\system\Plugin\migrate\source\d7

Code

public function query() {
  $query = parent::query();
  $query
    ->fields('i18n', [
    'lid',
    'textgroup',
    'context',
    'objectid',
    'type',
    'property',
    'objectindex',
    'format',
  ])
    ->fields('lt', [
    'lid',
    'translation',
    'language',
    'plid',
    'plural',
    'i18n_status',
  ])
    ->condition('i18n.textgroup', 'menu')
    ->isNotNull('lt.lid');
  $query
    ->addField('m', 'language', 'm_language');
  $query
    ->leftJoin('i18n_string', 'i18n', '[i18n].[objectid] = [m].[menu_name]');
  $query
    ->leftJoin('locales_target', 'lt', '[lt].[lid] = [i18n].[lid]');
  return $query;
}