public function RangeField::alterFieldInstanceMigration in Range 8
Same name in this branch
- 8 src/Plugin/migrate/field/d6/RangeField.php \Drupal\range\Plugin\migrate\field\d6\RangeField::alterFieldInstanceMigration()
- 8 src/Plugin/migrate/field/d7/RangeField.php \Drupal\range\Plugin\migrate\field\d7\RangeField::alterFieldInstanceMigration()
Apply any custom processing to the field instance migration.
Parameters
\Drupal\migrate\Plugin\MigrationInterface $migration: The migration entity.
Overrides FieldPluginBase::alterFieldInstanceMigration
File
- src/
Plugin/ migrate/ field/ d6/ RangeField.php, line 65
Class
- RangeField
- MigrateField Plugin for Drupal 6 range fields.
Namespace
Drupal\range\Plugin\migrate\field\d6Code
public function alterFieldInstanceMigration(MigrationInterface $migration) {
/** @var \Drupal\migrate\Row $row */
$row = $migration
->getSourcePlugin()
->current();
if ($this
->isRangeField($row
->getSourceProperty('type'))) {
$process_settings = [
'plugin' => 'd6_range_field_instance_settings',
];
$migration
->mergeProcessOfProperty('settings', $process_settings);
$process_defaults = [
'plugin' => 'd6_range_field_instance_defaults',
];
$migration
->mergeProcessOfProperty('default_value', $process_defaults);
}
parent::alterFieldInstanceMigration($migration);
}