You are here

public function TermNode::prepareRow in Drupal 10

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

Adds additional data to the row.

Parameters

\Drupal\migrate\Row $row: The row object.

Return value

bool FALSE if this row needs to be skipped.

Overrides SourcePluginBase::prepareRow

File

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

Class

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

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