function RdfMapping::prepareRow

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

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

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