Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / migrate / src / Plugin / migrate / destination / EntityFieldInstance.php
1 <?php
2
3 namespace Drupal\migrate\Plugin\migrate\destination;
4
5 /**
6  * Provides destination plugin for field_config configuration entities.
7  *
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.
11  *
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.
17  * @code
18  * id: field_instance_example
19  * label: Field instance example
20  * source:
21  *   plugin: empty
22  *   constants:
23  *     entity_type: node
24  *     field_name: field_text_example
25  *     bundle: article
26  *     label: Text field example
27  *     translatable: true
28  *  process:
29  *    entity_type: constants/entity_type
30  *    field_name: constants/field_name
31  *    bundle: constants/bundle
32  *    label: constants/label
33  *     translatable: constants/translatable
34  *  destination:
35  *    plugin: entity:field_config
36  *  migration_dependencies:
37  *    required:
38  *      - field_storage_example
39  * @endcode
40  *
41  * @see \Drupal\field\Entity\FieldConfig
42  * @see \Drupal\field\Entity\FieldConfigBase
43  *
44  * @MigrateDestination(
45  *   id = "entity:field_config"
46  * )
47  */
48 class EntityFieldInstance extends EntityConfigBase {
49
50   /**
51    * {@inheritdoc}
52    */
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';
59     }
60     return $ids;
61   }
62
63 }