function Field::prepareRow

Same name in this branch
  1. 11.x core/modules/field/src/Plugin/migrate/source/d6/Field.php \Drupal\field\Plugin\migrate\source\d6\Field::prepareRow()
Same name in other branches
  1. 9 core/modules/field/src/Plugin/migrate/source/d6/Field.php \Drupal\field\Plugin\migrate\source\d6\Field::prepareRow()
  2. 9 core/modules/field/src/Plugin/migrate/source/d7/Field.php \Drupal\field\Plugin\migrate\source\d7\Field::prepareRow()
  3. 8.9.x core/modules/field/src/Plugin/migrate/source/d6/Field.php \Drupal\field\Plugin\migrate\source\d6\Field::prepareRow()
  4. 8.9.x core/modules/field/src/Plugin/migrate/source/d7/Field.php \Drupal\field\Plugin\migrate\source\d7\Field::prepareRow()
  5. 10 core/modules/field/src/Plugin/migrate/source/d6/Field.php \Drupal\field\Plugin\migrate\source\d6\Field::prepareRow()
  6. 10 core/modules/field/src/Plugin/migrate/source/d7/Field.php \Drupal\field\Plugin\migrate\source\d7\Field::prepareRow()

Overrides SourcePluginBase::prepareRow

File

core/modules/field/src/Plugin/migrate/source/d7/Field.php, line 81

Class

Field
Drupal 7 field source from database.

Namespace

Drupal\field\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row, $keep = TRUE) {
    foreach (unserialize($row->getSourceProperty('data')) as $key => $value) {
        $row->setSourceProperty($key, $value);
    }
    $instances = $this->select('field_config_instance', 'fci')
        ->fields('fci')
        ->condition('field_name', $row->getSourceProperty('field_name'))
        ->condition('entity_type', $row->getSourceProperty('entity_type'))
        ->execute()
        ->fetchAll();
    $row->setSourceProperty('instances', $instances);
    return parent::prepareRow($row);
}

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