You are here

public function Term::prepareRow in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/taxonomy/src/Plugin/migrate/source/Term.php \Drupal\taxonomy\Plugin\migrate\source\Term::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/Term.php, line 85
Contains \Drupal\taxonomy\Plugin\migrate\source\Term.

Class

Term
Taxonomy term source from database.

Namespace

Drupal\taxonomy\Plugin\migrate\source

Code

public function prepareRow(Row $row) {

  // Find parents for this row.
  $parents = $this
    ->select($this->termHierarchyTable, 'th')
    ->fields('th', array(
    'parent',
    'tid',
  ))
    ->condition('tid', $row
    ->getSourceProperty('tid'))
    ->execute()
    ->fetchCol();
  $row
    ->setSourceProperty('parent', $parents);
  return parent::prepareRow($row);
}