function NodeComplete::prepareRow

Same name in other branches
  1. 9 core/modules/node/src/Plugin/migrate/source/d7/NodeComplete.php \Drupal\node\Plugin\migrate\source\d7\NodeComplete::prepareRow()
  2. 8.9.x core/modules/node/src/Plugin/migrate/source/d7/NodeComplete.php \Drupal\node\Plugin\migrate\source\d7\NodeComplete::prepareRow()
  3. 11.x core/modules/node/src/Plugin/migrate/source/d7/NodeComplete.php \Drupal\node\Plugin\migrate\source\d7\NodeComplete::prepareRow()

Overrides Node::prepareRow

File

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

Class

NodeComplete
Drupal 7 all node revisions 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'));
    }
    return parent::prepareRow($row);
}

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