EntityViewMode.php

Same filename in this branch
  1. 11.x core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php
Same filename in other branches
  1. 9 core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php
  2. 9 core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php
  3. 8.9.x core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php
  4. 8.9.x core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php
  5. 10 core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php
  6. 10 core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php

Namespace

Drupal\Core\Entity\Entity

File

core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php

View source
<?php

namespace Drupal\Core\Entity\Entity;

use Drupal\Core\Entity\EntityDisplayModeBase;
use Drupal\Core\Entity\EntityViewModeInterface;

/**
 * Defines the entity view mode configuration entity class.
 *
 * View modes let entities be displayed differently depending on the context.
 * For instance, a node can be displayed differently on its own page ('full'
 * mode), on the home page or taxonomy listings ('teaser' mode), or in an RSS
 * feed ('rss' mode). Modules taking part in the display of the entity (notably
 * the Field API) can adjust their behavior depending on the requested view
 * mode. An additional 'default' view mode is available for all entity types.
 * This view mode is not intended for actual entity display, but holds default
 * display settings. For each available view mode, administrators can configure
 * whether it should use its own set of field display settings, or just
 * replicate the settings of the 'default' view mode, thus reducing the amount
 * of display configurations to keep track of.
 *
 * @see \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllViewModes()
 * @see \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModes()
 * @see hook_entity_view_mode_info_alter()
 *
 * @ConfigEntityType(
 *   id = "entity_view_mode",
 *   label = @Translation("View mode"),
 *   entity_keys = {
 *     "id" = "id",
 *     "label" = "label",
 *     "description" = "description",
 *   },
 *   config_export = {
 *     "id",
 *     "label",
 *     "description",
 *     "targetEntityType",
 *     "cache",
 *   },
 *   constraints = {
 *     "ImmutableProperties" = {"id", "targetEntityType"},
 *   }
 * )
 */
class EntityViewMode extends EntityDisplayModeBase implements EntityViewModeInterface {

}

Classes

Title Deprecated Summary
EntityViewMode Defines the entity view mode configuration entity class.

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