You are here

public function RangeField::alterFieldMigration in Range 8

Apply any custom processing to the field migration.

Parameters

\Drupal\migrate\Plugin\MigrationInterface $migration: The migration entity.

Overrides FieldPluginBase::alterFieldMigration

File

src/Plugin/migrate/field/d6/RangeField.php, line 37

Class

RangeField
MigrateField Plugin for Drupal 6 range fields.

Namespace

Drupal\range\Plugin\migrate\field\d6

Code

public function alterFieldMigration(MigrationInterface $migration) {

  /** @var \Drupal\migrate\Row $row */
  $row = $migration
    ->getSourcePlugin()
    ->current();
  if ($this
    ->isRangeField($row
    ->getSourceProperty('type'))) {
    $process_type = [];
    $process_type[0]['map'] = [
      'range_decimal' => [
        'range' => 'range_decimal',
      ],
      'range_float' => [
        'range' => 'range_float',
      ],
      'range_integer' => [
        'range' => 'range_integer',
      ],
    ];
    $migration
      ->mergeProcessOfProperty('type', $process_type);
    $process_settings = [
      'plugin' => 'd6_range_field_settings',
    ];
    $migration
      ->mergeProcessOfProperty('settings', $process_settings);
  }
}