You are here

public function Term::query in Drupal 9

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()
  2. 9 core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php \Drupal\taxonomy\Plugin\migrate\source\d7\Term::query()
Same name and namespace in other branches
  1. 8 core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php \Drupal\taxonomy\Plugin\migrate\source\d7\Term::query()

Return value

\Drupal\Core\Database\Query\SelectInterface

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