You are here

public function Term::prepareRow in Drupal 8

Same name in this branch
  1. 8 core/modules/taxonomy/src/Plugin/migrate/source/Term.php \Drupal\taxonomy\Plugin\migrate\source\Term::prepareRow()
  2. 8 core/modules/taxonomy/src/Plugin/migrate/source/d6/Term.php \Drupal\taxonomy\Plugin\migrate\source\d6\Term::prepareRow()
  3. 8 core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php \Drupal\taxonomy\Plugin\migrate\source\d7\Term::prepareRow()
Same name and namespace in other branches
  1. 9 core/modules/taxonomy/src/Plugin/migrate/source/d6/Term.php \Drupal\taxonomy\Plugin\migrate\source\d6\Term::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

1 call to Term::prepareRow()
TermLocalizedTranslation::prepareRow in core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php
Adds additional data to the row.
1 method overrides Term::prepareRow()
TermLocalizedTranslation::prepareRow in core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php
Adds additional data to the row.

File

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

Class

Term
Taxonomy term source from database.

Namespace

Drupal\taxonomy\Plugin\migrate\source\d6

Code

public function prepareRow(Row $row) {

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