public function RangeFieldInstanceSettings::transform in Range 8
Same name in this branch
- 8 src/Plugin/migrate/process/d6/RangeFieldInstanceSettings.php \Drupal\range\Plugin\migrate\process\d6\RangeFieldInstanceSettings::transform()
- 8 src/Plugin/migrate/process/d7/RangeFieldInstanceSettings.php \Drupal\range\Plugin\migrate\process\d7\RangeFieldInstanceSettings::transform()
Get the range field instance settings.
Overrides ProcessPluginBase::transform
File
- src/
Plugin/ migrate/ process/ d7/ RangeFieldInstanceSettings.php, line 24
Class
- RangeFieldInstanceSettings
- Get the range field instance settings.
Namespace
Drupal\range\Plugin\migrate\process\d7Code
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
list($instance_settings) = $value;
// FROM/TO labels are moved to the widget settings.
unset($instance_settings['from']['label'], $instance_settings['to']['label']);
// Filter out any other settings, not present in the new module version.
$allowed_settings = [
'max' => NULL,
'min' => NULL,
'field' => NULL,
'from' => NULL,
'to' => NULL,
'combined' => NULL,
];
return array_intersect_key($instance_settings, $allowed_settings);
}