public function TermNode::prepareRow in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/taxonomy/src/Plugin/migrate/source/d6/TermNode.php \Drupal\taxonomy\Plugin\migrate\source\d6\TermNode::prepareRow()
Add 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 56 - 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\d6Code
public function prepareRow(Row $row) {
// Select the terms belonging to the revision selected.
$query = $this
->select('term_node', 'tn')
->fields('tn', array(
'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', array(
':vid' => $this->configuration['vid'],
));
$row
->setSourceProperty('tid', $query
->execute()
->fetchCol());
return parent::prepareRow($row);
}