function RdfMapping::prepareRow

Same name and namespace in other branches
  1. 8.9.x core/modules/rdf/src/Plugin/migrate/source/d7/RdfMapping.php \Drupal\rdf\Plugin\migrate\source\d7\RdfMapping::prepareRow()

File

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

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);
}

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