function Term::query

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

Overrides SqlBase::query

2 calls to Term::query()
TermLocalizedTranslation::query in core/modules/taxonomy/src/Plugin/migrate/source/d7/TermLocalizedTranslation.php
TermTranslation::query in core/modules/taxonomy/src/Plugin/migrate/source/d7/TermTranslation.php
2 methods override Term::query()
TermLocalizedTranslation::query in core/modules/taxonomy/src/Plugin/migrate/source/d7/TermLocalizedTranslation.php
TermTranslation::query in core/modules/taxonomy/src/Plugin/migrate/source/d7/TermTranslation.php

File

core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php, line 53

Class

Term
Drupal 7 taxonomy term source from database.

Namespace

Drupal\taxonomy\Plugin\migrate\source\d7

Code

public function query() {
    $query = $this->select('taxonomy_term_data', 'td')
        ->fields('td')
        ->distinct()
        ->orderBy('tid');
    $query->leftJoin('taxonomy_vocabulary', 'tv', '[td].[vid] = [tv].[vid]');
    $query->addField('tv', 'machine_name');
    if ($this->getDatabase()
        ->schema()
        ->fieldExists('taxonomy_vocabulary', 'i18n_mode')) {
        $query->addField('tv', 'i18n_mode');
    }
    if (isset($this->configuration['bundle'])) {
        $query->condition('tv.machine_name', (array) $this->configuration['bundle'], 'IN');
    }
    return $query;
}

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