class EntityViewMode

Same name in this branch
  1. 9 core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php \Drupal\Core\Entity\Entity\EntityViewMode
Same name and namespace in other branches
  1. 11.x core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
  2. 11.x core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php \Drupal\Core\Entity\Entity\EntityViewMode

Provides entity view mode destination plugin.

See EntityConfigBase for the available configuration options.

Example:


source:
  plugin: d7_view_mode
process:
  mode: view_mode
  label: view_mode
  targetEntityType: entity_type
destination:
  plugin: entity:entity_view_mode

This will add the results of the process ("mode", "label" and "targetEntityType") to an "entity_view_mode" entity.

Plugin annotation


@MigrateDestination(
  id = "entity:entity_view_mode"
)

Hierarchy

Expanded class hierarchy of EntityViewMode

See also

\Drupal\migrate\Plugin\migrate\destination\EntityConfigBase

File

core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php, line 31

Namespace

Drupal\migrate\Plugin\migrate\destination
View source
class EntityViewMode extends EntityConfigBase {
  
  /**
   * {@inheritdoc}
   */
  public function getIds() {
    $ids['targetEntityType']['type'] = 'string';
    $ids['mode']['type'] = 'string';
    return $ids;
  }
  
  /**
   * {@inheritdoc}
   */
  public function rollback(array $destination_identifier) {
    $destination_identifier = implode('.', $destination_identifier);
    parent::rollback([
      $destination_identifier,
    ]);
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.