function TermNode::query

Same name in other branches
  1. 8.9.x core/modules/taxonomy/src/Plugin/migrate/source/d6/TermNode.php \Drupal\taxonomy\Plugin\migrate\source\d6\TermNode::query()
  2. 10 core/modules/taxonomy/src/Plugin/migrate/source/d6/TermNode.php \Drupal\taxonomy\Plugin\migrate\source\d6\TermNode::query()
  3. 11.x core/modules/taxonomy/src/Plugin/migrate/source/d6/TermNode.php \Drupal\taxonomy\Plugin\migrate\source\d6\TermNode::query()

Overrides SqlBase::query

File

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

Class

TermNode
Drupal 6 term/node relationships (current revision) source from database.

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

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