class FieldTypeDefaults
Same name in this branch
- 8.9.x core/modules/field/src/Plugin/migrate/process/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\FieldTypeDefaults
- 8.9.x core/modules/field/src/Plugin/migrate/process/d7/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d7\FieldTypeDefaults
Same name in other branches
- 9 core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d6\FieldTypeDefaults
- 9 core/modules/field/src/Plugin/migrate/process/d7/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d7\FieldTypeDefaults
- 10 core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d6\FieldTypeDefaults
- 10 core/modules/field/src/Plugin/migrate/process/d7/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d7\FieldTypeDefaults
- 11.x core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d6\FieldTypeDefaults
- 11.x core/modules/field/src/Plugin/migrate/process/d7/FieldTypeDefaults.php \Drupal\field\Plugin\migrate\process\d7\FieldTypeDefaults
Gives us a chance to set per field defaults.
Plugin annotation
@MigrateProcessPlugin(
id = "d6_field_type_defaults"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\migrate\ProcessPluginBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\migrate\Plugin\MigrateProcessInterface
- class \Drupal\field\Plugin\migrate\process\d6\FieldTypeDefaults extends \Drupal\migrate\ProcessPluginBase
- class \Drupal\migrate\ProcessPluginBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\migrate\Plugin\MigrateProcessInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of FieldTypeDefaults
2 files declare their use of FieldTypeDefaults
- FieldTypeDefaults.php in core/
modules/ field/ src/ Plugin/ migrate/ process/ FieldTypeDefaults.php - 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\d6View 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
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
FieldTypeDefaults::transform | public | function | Performs the associated process. | Overrides ProcessPluginBase::transform | |
PluginInspectionInterface::getPluginDefinition | public | function | Gets the definition of the plugin implementation. | 6 | |
PluginInspectionInterface::getPluginId | public | function | Gets the plugin_id of the plugin instance. | 2 | |
ProcessPluginBase::multiple | public | function | Indicates whether the returned value requires multiple handling. | Overrides MigrateProcessInterface::multiple | 3 |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.