You are here

public function TermNode::query in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 31
Contains \Drupal\taxonomy\Plugin\migrate\source\d6\TermNode.

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', array(
    'nid',
    'vid',
  ))
    ->fields('n', array(
    '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', array(
    ':vid' => $this->configuration['vid'],
  ));
  $query
    ->innerJoin('node', 'n', static::JOIN);
  return $query;
}