function TermNode::prepareRow

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

Overrides SourcePluginBase::prepareRow

File

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

Class

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

Namespace

Drupal\taxonomy\Plugin\migrate\source\d6

Code

public function prepareRow(Row $row) {
    // Select the terms belonging to the revision selected.
    $query = $this->select('term_node', 'tn')
        ->fields('tn', [
        'tid',
    ])
        ->condition('n.nid', $row->getSourceProperty('nid'));
    $query->join('node', 'n', static::JOIN);
    $query->innerJoin('term_data', 'td', 'td.tid = tn.tid AND td.vid = :vid', [
        ':vid' => $this->configuration['vid'],
    ]);
    $row->setSourceProperty('tid', $query->execute()
        ->fetchCol());
    return parent::prepareRow($row);
}

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