function Term::prepareRow

Same name in this branch
  1. 8.9.x core/modules/taxonomy/src/Plugin/migrate/source/d6/Term.php \Drupal\taxonomy\Plugin\migrate\source\d6\Term::prepareRow()
  2. 8.9.x core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php \Drupal\taxonomy\Plugin\migrate\source\d7\Term::prepareRow()
Same name in other branches
  1. 9 core/modules/taxonomy/src/Plugin/migrate/source/d6/Term.php \Drupal\taxonomy\Plugin\migrate\source\d6\Term::prepareRow()
  2. 9 core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php \Drupal\taxonomy\Plugin\migrate\source\d7\Term::prepareRow()
  3. 10 core/modules/taxonomy/src/Plugin/migrate/source/d6/Term.php \Drupal\taxonomy\Plugin\migrate\source\d6\Term::prepareRow()
  4. 10 core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php \Drupal\taxonomy\Plugin\migrate\source\d7\Term::prepareRow()
  5. 11.x core/modules/taxonomy/src/Plugin/migrate/source/d6/Term.php \Drupal\taxonomy\Plugin\migrate\source\d6\Term::prepareRow()
  6. 11.x core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php \Drupal\taxonomy\Plugin\migrate\source\d7\Term::prepareRow()

Overrides SourcePluginBase::prepareRow

File

core/modules/taxonomy/src/Plugin/migrate/source/Term.php, line 86

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', [
        'parent',
        'tid',
    ])
        ->condition('tid', $row->getSourceProperty('tid'))
        ->execute()
        ->fetchCol();
    $row->setSourceProperty('parent', $parents);
    return parent::prepareRow($row);
}

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