public function Field::prepareRow in Drupal 10
Same name in this branch
- 10 core/modules/field/src/Plugin/migrate/source/d6/Field.php \Drupal\field\Plugin\migrate\source\d6\Field::prepareRow()
- 10 core/modules/field/src/Plugin/migrate/source/d7/Field.php \Drupal\field\Plugin\migrate\source\d7\Field::prepareRow()
Same name and namespace in other branches
- 8 core/modules/field/src/Plugin/migrate/source/d7/Field.php \Drupal\field\Plugin\migrate\source\d7\Field::prepareRow()
- 9 core/modules/field/src/Plugin/migrate/source/d7/Field.php \Drupal\field\Plugin\migrate\source\d7\Field::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/ field/ src/ Plugin/ migrate/ source/ d7/ Field.php, line 80
Class
- Field
- Drupal 7 field source from database.
Namespace
Drupal\field\Plugin\migrate\source\d7Code
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);
}