3 namespace Drupal\migrate\Plugin\migrate\destination;
6 * Provides destination plugin for field_config configuration entities.
8 * The Field API defines two primary data structures, FieldStorage and Field.
9 * A FieldStorage defines a particular type of data that can be attached to
10 * entities as a Field instance.
12 * The example below adds an instance of 'field_text_example' to 'article'
13 * bundle (node content type). The example uses the EmptySource source plugin
14 * and constant source values for the sake of simplicity. For an example on how
15 * the FieldStorage 'field_text_example' can be migrated, refer to
16 * \Drupal\migrate\Plugin\migrate\destination\EntityFieldStorageConfig.
18 * id: field_instance_example
19 * label: Field instance example
24 * field_name: field_text_example
26 * label: Text field example
29 * entity_type: constants/entity_type
30 * field_name: constants/field_name
31 * bundle: constants/bundle
32 * label: constants/label
33 * translatable: constants/translatable
35 * plugin: entity:field_config
36 * migration_dependencies:
38 * - field_storage_example
41 * @see \Drupal\field\Entity\FieldConfig
42 * @see \Drupal\field\Entity\FieldConfigBase
44 * @MigrateDestination(
45 * id = "entity:field_config"
48 class EntityFieldInstance extends EntityConfigBase {
53 public function getIds() {
54 $ids['entity_type']['type'] = 'string';
55 $ids['bundle']['type'] = 'string';
56 $ids['field_name']['type'] = 'string';
57 if ($this->isTranslationDestination()) {
58 $ids['langcode']['type'] = 'string';