function MenuTranslation::query

Same name in other branches
  1. 9 core/modules/system/src/Plugin/migrate/source/d7/MenuTranslation.php \Drupal\system\Plugin\migrate\source\d7\MenuTranslation::query()
  2. 11.x core/modules/system/src/Plugin/migrate/source/d7/MenuTranslation.php \Drupal\system\Plugin\migrate\source\d7\MenuTranslation::query()

Overrides Menu::query

File

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

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.