class MigrateField in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate_drupal/src/Annotation/MigrateField.php \Drupal\migrate_drupal\Annotation\MigrateField
Defines a field plugin annotation object.
Field plugins are responsible for handling the migration of custom fields (provided by CCK in Drupal 6 and Field API in Drupal 7) to Drupal 8. They are allowed to alter fieldable entity migrations when these migrations are being generated, and can compute destination field types for individual fields during the actual migration process.
Plugin Namespace: Plugin\migrate\field
Hierarchy
- class \Drupal\Component\Annotation\Plugin implements AnnotationInterface
- class \Drupal\migrate_drupal\Annotation\MigrateField
Expanded class hierarchy of MigrateField
Related topics
1 file declares its use of MigrateField
- MigrateFieldPluginManagerTest.php in core/
modules/ migrate_drupal/ tests/ src/ Unit/ MigrateFieldPluginManagerTest.php
1 string reference to 'MigrateField'
- migrate_drupal.services.yml in core/
modules/ migrate_drupal/ migrate_drupal.services.yml - core/modules/migrate_drupal/migrate_drupal.services.yml
23 classes are annotated with MigrateField
- D6FileField in core/
modules/ migrate_drupal/ tests/ modules/ migrate_field_plugin_manager_test/ src/ Plugin/ migrate/ field/ D6FileField.php - Plugin annotation @MigrateField( id = "d6_file", core = {6}, type_map = { "file" = "file" }, source_module = "foo", destination_module = "bar" )
- D6NoCoreVersionSpecified in core/
modules/ migrate_drupal/ tests/ modules/ migrate_field_plugin_manager_test/ src/ Plugin/ migrate/ field/ D6NoCoreVersionSpecified.php - Plugin annotation @MigrateField( id = "d6_no_core_version_specified", source_module = "foo", destination_module = "bar", )
- DateField in core/
modules/ datetime/ src/ Plugin/ migrate/ field/ DateField.php - Provides a field plugin for date and time fields.
- DateField in core/
modules/ datetime/ src/ Plugin/ migrate/ field/ d6/ DateField.php - Plugin annotation @MigrateField( id = "date", type_map = { "date" = "datetime", "datestamp" = "timestamp", "datetime" = "datetime", }, core = {6}, source_module = "date", destination_module = "datetime", weight = 9999999, )
- Email in core/
modules/ field/ src/ Plugin/ migrate/ field/ Email.php - MigrateField Plugin for Drupal 6 and 7 email fields.
File
- core/
modules/ migrate_drupal/ src/ Annotation/ MigrateField.php, line 20
Namespace
Drupal\migrate_drupal\AnnotationView source
class MigrateField extends Plugin {
/**
* {@inheritdoc}
*/
public function __construct($values) {
parent::__construct($values);
// Provide default value for core property, in case it's missing.
if (empty($this->definition['core'])) {
$this->definition['core'] = [
6,
];
}
}
/**
* The plugin ID.
*
* @var string
*/
public $id;
/**
* Map of D6 and D7 field types to D8 field type plugin IDs.
*
* @var string[]
*/
public $type_map = [];
/**
* The Drupal core version(s) this plugin applies to.
*
* @var int[]
*/
public $core;
/**
* Identifies the system providing the data the field plugin will read.
*
* The source_module is expected to be the name of a Drupal module that must
* be installed in the source database.
*
* @var string
*/
public $source_module;
/**
* Identifies the system handling the data the destination plugin will write.
*
* The destination_module is expected to be the name of a Drupal module on the
* destination site that must be installed.
*
* @var string
*/
public $destination_module;
/**
* The weight of this plugin relative to other plugins.
*
* The weight of this plugin relative to other plugins servicing the same
* field type and core version. The lowest weighted applicable plugin will be
* used for each field.
*
* @var int
*/
public $weight = 0;
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MigrateField:: |
public | property | The Drupal core version(s) this plugin applies to. | |
MigrateField:: |
public | property | Identifies the system handling the data the destination plugin will write. | |
MigrateField:: |
public | property | The plugin ID. | |
MigrateField:: |
public | property | Identifies the system providing the data the field plugin will read. | |
MigrateField:: |
public | property | Map of D6 and D7 field types to D8 field type plugin IDs. | |
MigrateField:: |
public | property | The weight of this plugin relative to other plugins. | |
MigrateField:: |
public | function |
Constructs a Plugin object. Overrides Plugin:: |
|
Plugin:: |
protected | property | The plugin definition read from the class annotation. | 1 |
Plugin:: |
public | function |
Gets the value of an annotation. Overrides AnnotationInterface:: |
5 |
Plugin:: |
public | function |
Gets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the unique ID for this annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
protected | function | Parses an annotation into its definition. | |
Plugin:: |
public | function |
Sets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Sets the name of the provider of the annotated class. Overrides AnnotationInterface:: |