Same name in this branch
  1. 10 core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d6\FieldTypeDefaults
  2. 10 core/modules/field/src/Plugin/migrate/process/d7/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d7\FieldTypeDefaults
Same name and namespace in other branches
  1. 8.9.x core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d6\FieldTypeDefaults
  2. 9 core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d6\FieldTypeDefaults

Gives us a chance to set per field defaults.

Plugin annotation


@MigrateProcessPlugin(
  id = "d6_field_type_defaults"
)

Hierarchy

  • class \Drupal\field\Plugin\migrate\process\d6\FieldTypeDefaults extends \Drupal\migrate\ProcessPluginBase

Expanded class hierarchy of FieldTypeDefaults

1 file declares its use of FieldTypeDefaults
FieldTypeDefaultsTest.php in core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php

File

core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php, line 17

Namespace

Drupal\field\Plugin\migrate\process\d6
View source
class FieldTypeDefaults extends ProcessPluginBase {

  /**
   * {@inheritdoc}
   */
  public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    if (is_array($value)) {
      if ($row
        ->getSourceProperty('module') == 'date') {
        $value = 'datetime_default';
      }
      else {
        throw new MigrateException(sprintf('Failed to lookup field type %s in the static map.', var_export($value, TRUE)));
      }
    }
    return $value;
  }

}

Members