3 namespace Drupal\migrate\Plugin\migrate\destination;
6 * This class imports one component of an entity display.
8 * Destination properties expected in the imported row:
9 * - entity_type: The entity type ID.
10 * - bundle: The entity bundle.
11 * - view_mode: The machine name of the view mode.
12 * - field_name: The machine name of the field to be imported into the display.
13 * - options: (optional) An array of options for displaying the field in this
24 * field_name: user_picture
32 * entity_type: 'constants/entity_type'
33 * bundle: 'constants/bundle'
34 * view_mode: 'constants/view_mode'
35 * field_name: 'constants/field_name'
36 * type: 'constants/type'
37 * options: 'constants/options'
38 * 'options/type': '@type'
40 * plugin: component_entity_display
43 * This will add the "user_picture" image field to the "default" view mode of
44 * the "user" bundle of the "user" entity type with options as defined by the
45 * "options" constant, for example the label will be hidden.
47 * @MigrateDestination(
48 * id = "component_entity_display"
51 class PerComponentEntityDisplay extends ComponentEntityDisplayBase {
53 const MODE_NAME = 'view_mode';
58 protected function getEntity($entity_type, $bundle, $view_mode) {
59 return entity_get_display($entity_type, $bundle, $view_mode);