You are here

public function RangeFieldInstanceDefaults::transform in Range 8

Set the range field instance defaults.

Overrides ProcessPluginBase::transform

File

src/Plugin/migrate/process/d6/RangeFieldInstanceDefaults.php, line 24

Class

RangeFieldInstanceDefaults
Get the range field instance defaults.

Namespace

Drupal\range\Plugin\migrate\process\d6

Code

public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
  list($widget_type, $widget_settings) = $value;
  if (isset($widget_settings['default_value'][0]['value']) && is_numeric($widget_settings['default_value'][0]['value'])) {
    return [
      [
        'from' => $widget_settings['default_value'][0]['value'],
        'to' => $widget_settings['default_value'][0]['value'],
      ],
    ];
  }
  return [];
}