8.5.x Node.php Node::prepareRow(Row $row)
8.5.x Node.php Node::prepareRow(Row $row)
8.0.x Node.php Node::prepareRow(Row $row)
8.0.x Node.php Node::prepareRow(Row $row)
8.1.x Node.php Node::prepareRow(Row $row)
8.1.x Node.php Node::prepareRow(Row $row)
8.2.x Node.php Node::prepareRow(Row $row)
8.2.x Node.php Node::prepareRow(Row $row)
8.3.x Node.php Node::prepareRow(Row $row)
8.3.x Node.php Node::prepareRow(Row $row)
8.4.x Node.php Node::prepareRow(Row $row)
8.4.x Node.php Node::prepareRow(Row $row)
8.6.x Node.php Node::prepareRow(Row $row)
8.6.x Node.php Node::prepareRow(Row $row)

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

File

core/modules/node/src/Plugin/migrate/source/d7/Node.php, line 106

Class

Node
Drupal 7 node source from database.

Namespace

Drupal\node\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {

  // Get Field API field values.
  foreach (array_keys($this
    ->getFields('node', $row
    ->getSourceProperty('type'))) as $field) {
    $nid = $row
      ->getSourceProperty('nid');
    $vid = $row
      ->getSourceProperty('vid');
    $row
      ->setSourceProperty($field, $this
      ->getFieldValues('node', $field, $nid, $vid));
  }

  // Make sure we always have a translation set.
  if ($row
    ->getSourceProperty('tnid') == 0) {
    $row
      ->setSourceProperty('tnid', $row
      ->getSourceProperty('nid'));
  }
  return parent::prepareRow($row);
}