You are here

public function RdfMapping::prepareRow in Drupal 8

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

File

core/modules/rdf/src/Plugin/migrate/source/d7/RdfMapping.php, line 28

Class

RdfMapping
Drupal 7 rdf source from database.

Namespace

Drupal\rdf\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {
  $field_mappings = [];
  foreach (unserialize($row
    ->getSourceProperty('mapping')) as $field => $mapping) {
    if ($field === 'rdftype') {
      $row
        ->setSourceProperty('types', $mapping);
    }
    else {
      $field_mappings[$field] = $mapping;
    }
  }
  $row
    ->setSourceProperty('fieldMappings', $field_mappings);
  return parent::prepareRow($row);
}