class EntityViewMode
Same name in this branch
- 11.x core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
Same name and namespace in other branches
- 10 core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
- 10 core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php \Drupal\Core\Entity\Entity\EntityViewMode
- 9 core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
- 9 core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php \Drupal\Core\Entity\Entity\EntityViewMode
- 8.9.x core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
- 8.9.x core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php \Drupal\Core\Entity\Entity\EntityViewMode
- main core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
- main 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.
Attributes
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements \Drupal\Core\Entity\EntityInterface uses \Drupal\Core\Cache\RefinableCacheableDependencyTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements \Drupal\Core\Config\Entity\ConfigEntityInterface uses \Drupal\Core\Plugin\PluginDependencyTrait, \Drupal\Core\Entity\SynchronizableEntityTrait extends \Drupal\Core\Entity\EntityBase
- class \Drupal\Core\Entity\EntityDisplayModeBase implements \Drupal\Core\Entity\EntityDisplayModeInterface extends \Drupal\Core\Config\Entity\ConfigEntityBase
- class \Drupal\Core\Entity\Entity\EntityViewMode implements \Drupal\Core\Entity\EntityViewModeInterface extends \Drupal\Core\Entity\EntityDisplayModeBase
- class \Drupal\Core\Entity\EntityDisplayModeBase implements \Drupal\Core\Entity\EntityDisplayModeInterface extends \Drupal\Core\Config\Entity\ConfigEntityBase
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements \Drupal\Core\Config\Entity\ConfigEntityInterface uses \Drupal\Core\Plugin\PluginDependencyTrait, \Drupal\Core\Entity\SynchronizableEntityTrait extends \Drupal\Core\Entity\EntityBase
Expanded class hierarchy of EntityViewMode
See also
\Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllViewModes()
\Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModes()
hook_entity_view_mode_info_alter()
32 files declare their use of EntityViewMode
- CKEditor5AllowedTagsTest.php in core/
modules/ ckeditor5/ tests/ src/ FunctionalJavascript/ CKEditor5AllowedTagsTest.php - CommentHooks.php in core/
modules/ comment/ src/ Hook/ CommentHooks.php - 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
File
-
core/
lib/ Drupal/ Core/ Entity/ Entity/ EntityViewMode.php, line 29
Namespace
Drupal\Core\Entity\EntityView source
class EntityViewMode extends EntityDisplayModeBase implements EntityViewModeInterface {
}
Members
| Title Sort descending | Deprecated | Modifiers | Object type | Summary | Member alias | Overriden Title | 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 | Deprecated | 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 | Creates a duplicate of the entity. | Overrides EntityBase::createDuplicate | 1 | ||
| ConfigEntityBase::disable | public | function | #[ActionMethod(adminLabel: new TranslatableMarkup('Disable'), pluralize: FALSE)] | Overrides ConfigEntityInterface::disable | 1 | ||
| ConfigEntityBase::enable | public | function | #[ActionMethod(adminLabel: new TranslatableMarkup('Enable'), pluralize: FALSE)] | Overrides ConfigEntityInterface::enable | |||
| ConfigEntityBase::get | public | function | Returns the value of a property. | Overrides ConfigEntityInterface::get | |||
| ConfigEntityBase::getCacheTagsToInvalidate | public | function | Returns the cache tags that should be used to invalidate caches. | Overrides EntityBase::getCacheTagsToInvalidate | 2 | ||
| ConfigEntityBase::getConfigDependencyName | public | function | Gets the configuration dependency name. | Overrides EntityBase::getConfigDependencyName | |||
| ConfigEntityBase::getConfigManager | protected static | function | Gets the configuration manager. | ||||
| ConfigEntityBase::getConfigTarget | public | function | Gets the configuration target identifier for the entity. | Overrides EntityBase::getConfigTarget | |||
| ConfigEntityBase::getDependencies | public | function | Gets the configuration dependencies. | Overrides ConfigEntityInterface::getDependencies | |||
| ConfigEntityBase::getOriginalId | public | function | Gets the original ID. | Overrides EntityBase::getOriginalId | |||
| ConfigEntityBase::getThirdPartyProviders | public | function | Gets the list of third parties that store information. | Overrides ThirdPartySettingsInterface::getThirdPartyProviders | |||
| ConfigEntityBase::getThirdPartySetting | public | function | Gets the value of a third-party setting. | Overrides ThirdPartySettingsInterface::getThirdPartySetting | |||
| ConfigEntityBase::getThirdPartySettings | public | function | Gets all third-party settings of a given module. | Overrides ThirdPartySettingsInterface::getThirdPartySettings | |||
| ConfigEntityBase::getTypedConfig | protected | function | Gets the typed config manager. | ||||
| ConfigEntityBase::hasTrustedData | public | function | Gets whether on not the data is trusted. | Overrides ConfigEntityInterface::hasTrustedData | |||
| ConfigEntityBase::invalidateTagsOnDelete | protected static | function | Override to never invalidate the individual entities' cache tags; the config system already invalidates them. |
Overrides EntityBase::invalidateTagsOnDelete | |||
| ConfigEntityBase::invalidateTagsOnSave | protected | function | Override to never invalidate the entity's cache tag; the config system already invalidates it. |
Overrides EntityBase::invalidateTagsOnSave | |||
| ConfigEntityBase::isInstallable | public | function | Checks whether this entity is installable. | Overrides ConfigEntityInterface::isInstallable | 2 | ||
| ConfigEntityBase::isNew | public | function | Overrides EntityBase::isNew(). | Overrides EntityBase::isNew | |||
| ConfigEntityBase::isUninstalling | public | function | Returns whether this entity is being changed during the uninstall process. | Overrides ConfigEntityInterface::isUninstalling | |||
| ConfigEntityBase::onDependencyRemoval | public | function | Informs the entity that entities it depends on will be deleted. | Overrides ConfigEntityInterface::onDependencyRemoval | 8 | ||
| ConfigEntityBase::save | public | function | Saves an entity permanently. | Overrides EntityBase::save | 2 | ||
| ConfigEntityBase::set | public | function | #[ActionMethod(adminLabel: new TranslatableMarkup('Set a value'), pluralize: 'setMultiple')] | Overrides ConfigEntityInterface::set | 1 | ||
| ConfigEntityBase::setOriginalId | public | function | Sets the original ID. | Overrides EntityBase::setOriginalId | |||
| ConfigEntityBase::setStatus | public | function | #[ActionMethod(adminLabel: new TranslatableMarkup('Set status'), pluralize: FALSE)] | Overrides ConfigEntityInterface::setStatus | |||
| ConfigEntityBase::setThirdPartySetting | public | function | #[ActionMethod(adminLabel: new TranslatableMarkup('Set third-party setting'))] | Overrides ThirdPartySettingsInterface::setThirdPartySetting | |||
| ConfigEntityBase::setUninstalling | public | function | |||||
| ConfigEntityBase::status | public | function | Returns whether the configuration entity is enabled. | Overrides ConfigEntityInterface::status | 4 | ||
| ConfigEntityBase::toArray | public | function | Gets an array of all property values. | Overrides EntityBase::toArray | 3 | ||
| ConfigEntityBase::toUrl | public | function | Gets the URL object for the entity. | Overrides EntityBase::toUrl | |||
| ConfigEntityBase::trustData | public | function | Sets that the data should be trusted. | Overrides ConfigEntityInterface::trustData | |||
| ConfigEntityBase::unsetThirdPartySetting | public | function | Unsets a third-party setting. | Overrides ThirdPartySettingsInterface::unsetThirdPartySetting | |||
| ConfigEntityBase::__construct | public | function | Constructs an Entity object. | Overrides EntityBase::__construct | 9 | ||
| ConfigEntityBase::__sleep | public | function | Overrides EntityBase::__sleep | 4 | |||
| 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 | 2 | |||
| DependencySerializationTrait::__wakeup | public | function | 2 | ||||
| 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::$originalEntity | protected | property | The original unchanged entity. | ||||
| EntityBase::$typedData | protected | property | A weak reference to the typed data object wrapping this entity. | ||||
| EntityBase::access | public | function | Overrides AccessibleInterface::access | 1 | |||
| EntityBase::bundle | public | function | Overrides EntityInterface::bundle | 1 | |||
| EntityBase::create | public static | function | Overrides EntityInterface::create | 2 | |||
| EntityBase::delete | public | function | Overrides EntityInterface::delete | 1 | |||
| EntityBase::enforceIsNew | public | function | Overrides EntityInterface::enforceIsNew | ||||
| EntityBase::entityTypeBundleInfo | protected | function | Gets the entity type bundle info service. | ||||
| EntityBase::entityTypeManager | protected | function | Gets the entity type manager. | ||||
| EntityBase::getCacheContexts | public | function | Overrides CacheableDependencyTrait::getCacheContexts | ||||
| EntityBase::getCacheMaxAge | public | function | Overrides CacheableDependencyTrait::getCacheMaxAge | ||||
| EntityBase::getCacheTags | public | function | Overrides CacheableDependencyTrait::getCacheTags | ||||
| EntityBase::getConfigDependencyKey | public | function | Overrides EntityInterface::getConfigDependencyKey | ||||
| EntityBase::getEntityType | public | function | Overrides EntityInterface::getEntityType | 1 | |||
| EntityBase::getEntityTypeId | public | function | Overrides EntityInterface::getEntityTypeId | ||||
| EntityBase::getListCacheTagsToInvalidate | protected | function | The list cache tags to invalidate for this entity. | ||||
| EntityBase::getOriginal | public | function | Overrides EntityInterface::getOriginal | ||||
| EntityBase::getTypedData | public | function | #[\NoDiscard] | Overrides EntityInterface::getTypedData | |||
| EntityBase::getTypedDataClass | private | function | Returns the typed data class name for this entity. | ||||
| EntityBase::hasLinkTemplate | public | function | Overrides EntityInterface::hasLinkTemplate | ||||
| EntityBase::id | public | function | Overrides EntityInterface::id | 10 | |||
| EntityBase::label | public | function | Overrides EntityInterface::label | 6 | |||
| EntityBase::language | public | function | Overrides EntityInterface::language | 1 | |||
| EntityBase::languageManager | protected | function | Gets the language manager. | ||||
| EntityBase::linkTemplates | protected | function | Gets an array link templates. | 1 | |||
| EntityBase::load | public static | function | Overrides EntityInterface::load | ||||
| EntityBase::loadMultiple | public static | function | Overrides EntityInterface::loadMultiple | ||||
| EntityBase::postCreate | public | function | Overrides EntityInterface::postCreate | 5 | |||
| EntityBase::postDelete | public static | function | Overrides EntityInterface::postDelete | 17 | |||
| EntityBase::postLoad | public static | function | Overrides EntityInterface::postLoad | 3 | |||
| EntityBase::postSave | public | function | Overrides EntityInterface::postSave | 12 | |||
| EntityBase::preCreate | public static | function | Overrides EntityInterface::preCreate | 6 | |||
| EntityBase::referencedEntities | public | function | Overrides EntityInterface::referencedEntities | 1 | |||
| EntityBase::setOriginal | public | function | Overrides EntityInterface::setOriginal | ||||
| EntityBase::toLink | public | function | Overrides EntityInterface::toLink | ||||
| EntityBase::uriRelationships | public | function | Overrides EntityInterface::uriRelationships | ||||
| EntityBase::uuid | public | function | Overrides EntityInterface::uuid | 1 | |||
| EntityBase::uuidGenerator | protected | function | Gets the UUID generator. | ||||
| EntityBase::__get | public | function | 1 | ||||
| EntityBase::__isset | public | function | 1 | ||||
| EntityBase::__set | public | function | 1 | ||||
| EntityBase::__unset | public | function | 1 | ||||
| EntityDisplayModeBase::$cache | protected | property | Whether or not the rendered output of this view mode is cached by default. | ||||
| EntityDisplayModeBase::$description | protected | property | Description of the form or view mode. | ||||
| 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. | Overrides ConfigEntityBase::$status | |||
| EntityDisplayModeBase::$targetEntityType | protected | property | The entity type this form or view mode is used for. | ||||
| EntityDisplayModeBase::calculateDependencies | public | function | Overrides ConfigEntityBase::calculateDependencies | ||||
| EntityDisplayModeBase::getDescription | public | function | Overrides EntityDisplayModeInterface::getDescription | ||||
| EntityDisplayModeBase::getTargetType | public | function | Overrides EntityDisplayModeInterface::getTargetType | ||||
| EntityDisplayModeBase::preDelete | public static | function | Overrides ConfigEntityBase::preDelete | ||||
| EntityDisplayModeBase::preSave | public | function | Overrides ConfigEntityBase::preSave | ||||
| EntityDisplayModeBase::setTargetType | public | function | Overrides EntityDisplayModeInterface::setTargetType | ||||
| EntityDisplayModeBase::sort | public static | function | Overrides ConfigEntityBase::sort | ||||
| EntityDisplayModeBase::urlRouteParameters | protected | function | Overrides EntityBase::urlRouteParameters | ||||
| 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. | 1 | |||
| PluginDependencyTrait::themeHandler | protected | function | Wraps the theme handler. | 1 | |||
| RefinableCacheableDependencyTrait::addCacheableDependency | public | function | 1 | ||||
| RefinableCacheableDependencyTrait::addCacheContexts | public | function | |||||
| RefinableCacheableDependencyTrait::addCacheTags | public | function | |||||
| RefinableCacheableDependencyTrait::mergeCacheMaxAge | public | function | |||||
| SynchronizableEntityTrait::$isSyncing | protected | property | Is entity being created updated or deleted through 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.