function VocabularyTranslation::query

Same name in this branch
  1. 11.x core/modules/taxonomy/src/Plugin/migrate/source/d7/VocabularyTranslation.php \Drupal\taxonomy\Plugin\migrate\source\d7\VocabularyTranslation::query()
Same name and namespace in other branches
  1. 9 core/modules/taxonomy/src/Plugin/migrate/source/d6/VocabularyTranslation.php \Drupal\taxonomy\Plugin\migrate\source\d6\VocabularyTranslation::query()
  2. 9 core/modules/taxonomy/src/Plugin/migrate/source/d7/VocabularyTranslation.php \Drupal\taxonomy\Plugin\migrate\source\d7\VocabularyTranslation::query()
  3. 8.9.x core/modules/taxonomy/src/Plugin/migrate/source/d6/VocabularyTranslation.php \Drupal\taxonomy\Plugin\migrate\source\d6\VocabularyTranslation::query()
  4. 8.9.x core/modules/taxonomy/src/Plugin/migrate/source/d7/VocabularyTranslation.php \Drupal\taxonomy\Plugin\migrate\source\d7\VocabularyTranslation::query()
  5. 10 core/modules/taxonomy/src/Plugin/migrate/source/d6/VocabularyTranslation.php \Drupal\taxonomy\Plugin\migrate\source\d6\VocabularyTranslation::query()
  6. 10 core/modules/taxonomy/src/Plugin/migrate/source/d7/VocabularyTranslation.php \Drupal\taxonomy\Plugin\migrate\source\d7\VocabularyTranslation::query()

Overrides SqlBase::query

File

core/modules/taxonomy/src/Plugin/migrate/source/d6/VocabularyTranslation.php, line 28

Class

VocabularyTranslation
Drupal 6 i18n vocabulary translations source from database.

Namespace

Drupal\taxonomy\Plugin\migrate\source\d6

Code

public function query() {
    $query = $this->select('vocabulary', 'v')
        ->fields('v')
        ->fields('i18n', [
        'lid',
        'type',
        'property',
        'objectid',
    ])
        ->fields('lt', [
        'lid',
        'translation',
    ])
        ->condition('i18n.type', 'vocabulary');
    $query->addField('lt', 'language', 'lt.language');
    // The i18n_strings table has two columns containing the object ID, objectid
    // and objectindex. The objectid column is a text field. Therefore, for the
    // join to work in PostgreSQL, use the objectindex field as this is numeric
    // like the vid field.
    $query->join('i18n_strings', 'i18n', '[v].[vid] = [i18n].[objectindex]');
    $query->innerJoin('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.