You are here

public function NodeComplete::prepareRow in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/node/src/Plugin/migrate/source/d7/NodeComplete.php \Drupal\node\Plugin\migrate\source\d7\NodeComplete::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 Node::prepareRow

File

core/modules/node/src/Plugin/migrate/source/d7/NodeComplete.php, line 60

Class

NodeComplete
Gets all node revisions from the source, including translation revisions.

Namespace

Drupal\node\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {

  // Override properties when this is an entity translation revision. The tnid
  // will be set in d7_node source plugin to the value of 'nid'.
  if ($row
    ->getSourceProperty('etr_created')) {
    $row
      ->setSourceProperty('vid', $row
      ->getSourceProperty('revision_id'));
    $row
      ->setSourceProperty('created', $row
      ->getSourceProperty('etr_created'));
    $row
      ->setSourceProperty('timestamp', $row
      ->getSourceProperty('etr_changed'));
    $row
      ->setSourceProperty('revision_uid', $row
      ->getSourceProperty('etr_uid'));
    $row
      ->setSourceProperty('source_langcode', $row
      ->getSourceProperty('source'));
  }
  parent::prepareRow($row);
}