You are here

public function TermNode::query in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/taxonomy/src/Plugin/migrate/source/d6/TermNode.php \Drupal\taxonomy\Plugin\migrate\source\d6\TermNode::query()

Return value

\Drupal\Core\Database\Query\SelectInterface

Overrides SqlBase::query

File

core/modules/taxonomy/src/Plugin/migrate/source/d6/TermNode.php, line 26

Class

TermNode
Source returning tids from the term_node table for the current revision.

Namespace

Drupal\taxonomy\Plugin\migrate\source\d6

Code

public function query() {
  $query = $this
    ->select('term_node', 'tn')
    ->distinct()
    ->fields('tn', [
    'nid',
    'vid',
  ])
    ->fields('n', [
    'type',
  ]);

  // Because this is an inner join it enforces the current revision.
  $query
    ->innerJoin('term_data', 'td', 'td.tid = tn.tid AND td.vid = :vid', [
    ':vid' => $this->configuration['vid'],
  ]);
  $query
    ->innerJoin('node', 'n', static::JOIN);
  return $query;
}