class EntityViewMode

Same name in this branch
  1. 8.9.x core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\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
  3. 10 core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
  4. 10 core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php \Drupal\Core\Entity\Entity\EntityViewMode
  5. 9 core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
  6. 9 core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php \Drupal\Core\Entity\Entity\EntityViewMode

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.

Plugin annotation


@ConfigEntityType(
  id = "entity_view_mode",
  label = @Translation("View mode"),
  entity_keys = {
    "id" = "id",
    "label" = "label"
  },
  config_export = {
    "id",
    "label",
    "targetEntityType",
    "cache",
  }
)

Hierarchy

Expanded class hierarchy of EntityViewMode

See also

\Drupal\Core\Entity\EntityManagerInterface::getAllViewModes()

\Drupal\Core\Entity\EntityManagerInterface::getViewModes()

hook_entity_view_mode_info_alter()

19 files declare their use of EntityViewMode
CKEditorIntegrationTest.php in core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
comment.module in core/modules/comment/comment.module
Enables users to comment on published content.
CommentIntegrationTest.php in core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php
CommentInterfaceTest.php in core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
DisplayApiTest.php in core/modules/field/tests/src/Kernel/DisplayApiTest.php

... See full list

File

core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php, line 42

Namespace

Drupal\Core\Entity\Entity
View source
class EntityViewMode extends EntityDisplayModeBase implements EntityViewModeInterface {

}

Members

Title Sort descending Deprecated Modifiers Object type Summary Member alias Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
ConfigEntityBase::$isUninstalling private property Whether the config is being deleted by the uninstall process.
ConfigEntityBase::$langcode protected property The language code of the entity's default language.
ConfigEntityBase::$originalId protected property The original ID of the configuration entity.
ConfigEntityBase::$third_party_settings protected property Third party entity settings.
ConfigEntityBase::$trustedData protected property Trust supplied data and not use configuration schema on save.
ConfigEntityBase::$uuid protected property The UUID for this entity.
ConfigEntityBase::$_core protected property Information maintained by Drupal core about configuration.
ConfigEntityBase::addDependency protected function Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
ConfigEntityBase::createDuplicate public function
ConfigEntityBase::disable public function 1
ConfigEntityBase::enable public function
ConfigEntityBase::get public function
ConfigEntityBase::getCacheTagsToInvalidate public function
ConfigEntityBase::getConfigDependencyName public function
ConfigEntityBase::getConfigManager protected static function Gets the configuration manager.
ConfigEntityBase::getConfigTarget public function
ConfigEntityBase::getDependencies public function
ConfigEntityBase::getOriginalId public function
ConfigEntityBase::getThirdPartyProviders public function
ConfigEntityBase::getThirdPartySetting public function
ConfigEntityBase::getThirdPartySettings public function
ConfigEntityBase::getTypedConfig protected function Gets the typed config manager.
ConfigEntityBase::hasTrustedData public function
ConfigEntityBase::invalidateTagsOnDelete protected static function Override to never invalidate the individual entities' cache tags; the
config system already invalidates them.
ConfigEntityBase::invalidateTagsOnSave protected function Override to never invalidate the entity's cache tag; the config system
already invalidates it.
ConfigEntityBase::isInstallable public function
ConfigEntityBase::isNew public function Overrides Entity::isNew().
ConfigEntityBase::isUninstalling public function
ConfigEntityBase::link public function
ConfigEntityBase::onDependencyRemoval public function 2
ConfigEntityBase::save public function
ConfigEntityBase::set public function
ConfigEntityBase::setOriginalId public function
ConfigEntityBase::setStatus public function
ConfigEntityBase::setThirdPartySetting public function
ConfigEntityBase::setUninstalling public function
ConfigEntityBase::status public function
ConfigEntityBase::toArray public function 1
ConfigEntityBase::toUrl public function
ConfigEntityBase::trustData public function
ConfigEntityBase::unsetThirdPartySetting public function
ConfigEntityBase::url public function
ConfigEntityBase::urlInfo public function
ConfigEntityBase::__construct public function 2
ConfigEntityBase::__sleep public function
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function Aliased as: traitSleep
DependencySerializationTrait::__wakeup public function
DependencyTrait::$dependencies protected property The object's dependencies.
DependencyTrait::addDependencies protected function Adds multiple dependencies.
DependencyTrait::addDependency protected function Adds a dependency. Aliased as: addDependencyTrait
EntityBase::$enforceIsNew protected property Boolean indicating whether the entity should be forced to be new.
EntityBase::$entityTypeId protected property The entity type.
EntityBase::$typedData protected property A typed data object wrapping this entity.
EntityBase::access public function 1
EntityBase::bundle public function 1
EntityBase::create public static function
EntityBase::delete public function
EntityBase::enforceIsNew public function
EntityBase::entityManager Deprecated protected function Gets the entity manager.
EntityBase::entityTypeBundleInfo protected function Gets the entity type bundle info service.
EntityBase::entityTypeManager protected function Gets the entity type manager.
EntityBase::getCacheContexts public function
EntityBase::getCacheMaxAge public function
EntityBase::getCacheTags public function
EntityBase::getConfigDependencyKey public function
EntityBase::getEntityType public function
EntityBase::getEntityTypeId public function
EntityBase::getListCacheTagsToInvalidate protected function The list cache tags to invalidate for this entity.
EntityBase::getTypedData public function
EntityBase::hasLinkTemplate public function
EntityBase::id public function 2
EntityBase::label public function 1
EntityBase::language public function 1
EntityBase::languageManager protected function Gets the language manager.
EntityBase::linkTemplates protected function Gets an array link templates. 1
EntityBase::load public static function
EntityBase::loadMultiple public static function
EntityBase::postCreate public function 1
EntityBase::postDelete public static function 2
EntityBase::postLoad public static function
EntityBase::postSave public function 3
EntityBase::preCreate public static function 1
EntityBase::referencedEntities public function 1
EntityBase::toLink public function
EntityBase::uriRelationships public function
EntityBase::uuid public function 1
EntityBase::uuidGenerator protected function Gets the UUID generator.
EntityDisplayModeBase::$cache protected property Whether or not the rendered output of this view mode is cached by default.
EntityDisplayModeBase::$id protected property The ID of the form or view mode.
EntityDisplayModeBase::$label protected property The human-readable name of the form or view mode.
EntityDisplayModeBase::$status protected property Whether or not this form or view mode has custom settings by default.
EntityDisplayModeBase::$targetEntityType protected property The entity type this form or view mode is used for.
EntityDisplayModeBase::calculateDependencies public function
EntityDisplayModeBase::getTargetType public function
EntityDisplayModeBase::preDelete public static function
EntityDisplayModeBase::preSave public function
EntityDisplayModeBase::setTargetType public function
EntityDisplayModeBase::sort public static function
EntityDisplayModeBase::urlRouteParameters protected function
PluginDependencyTrait::calculatePluginDependencies protected function Calculates and adds dependencies of a specific plugin instance. 1
PluginDependencyTrait::getPluginDependencies protected function Calculates and returns dependencies of a specific plugin instance.
PluginDependencyTrait::moduleHandler protected function Wraps the module handler.
PluginDependencyTrait::themeHandler protected function Wraps the theme handler.
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
SynchronizableEntityTrait::$isSyncing protected property Whether this entity is being created, updated or deleted through a
synchronization process.
SynchronizableEntityTrait::isSyncing public function
SynchronizableEntityTrait::setSyncing public function

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