public function TermNode::prepareRow in Drupal 8
Same name and namespace in other branches
- 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 51
Class
- TermNode
- Source returning tids from the term_node table for the current revision.
Namespace
Drupal\taxonomy\Plugin\migrate\source\d6Code
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);
}