Drupal 8  8.0.2
EntityViewDisplay Class Reference
Inheritance diagram for EntityViewDisplay:

Public Member Functions

 __construct (array $values, $entity_type)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 getRenderer ($field_name)
 
 build (FieldableEntityInterface $entity)
 
 getPluginCollections ()
 
- Public Member Functions inherited from EntityDisplayBase
 __construct (array $values, $entity_type)
 
 getTargetEntityTypeId ()
 
 getMode ()
 
 getOriginalMode ()
 
 getTargetBundle ()
 
 setTargetBundle ($bundle)
 
 id ()
 
 preSave (EntityStorageInterface $storage, $update=TRUE)
 
 calculateDependencies ()
 
 toArray ()
 
 createCopy ($mode)
 
 getComponents ()
 
 getComponent ($name)
 
 setComponent ($name, array $options=array())
 
 removeComponent ($name)
 
 getHighestWeight ()
 
 onDependencyRemoval (array $dependencies)
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from ConfigEntityBase
 __construct (array $values, $entity_type)
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 isNew ()
 
 get ($property_name)
 
 set ($property_name, $value)
 
 enable ()
 
 disable ()
 
 setStatus ($status)
 
 status ()
 
 setSyncing ($syncing)
 
 isSyncing ()
 
 setUninstalling ($uninstalling)
 
 isUninstalling ()
 
 createDuplicate ()
 
 preSave (EntityStorageInterface $storage)
 
 calculateDependencies ()
 
 urlInfo ($rel= 'edit-form', array $options=[])
 
 url ($rel= 'edit-form', $options=array())
 
 link ($text=NULL, $rel= 'edit-form', array $options=[])
 
 toUrl ($rel= 'edit-form', array $options=[])
 
 getCacheTagsToInvalidate ()
 
 getDependencies ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
 onDependencyRemoval (array $dependencies)
 
 setThirdPartySetting ($module, $key, $value)
 
 getThirdPartySetting ($module, $key, $default=NULL)
 
 getThirdPartySettings ($module)
 
 unsetThirdPartySetting ($module, $key)
 
 getThirdPartyProviders ()
 
 isInstallable ()
 
 trustData ()
 
 hasTrustedData ()
 
 save ()
 
- Public Member Functions inherited from Entity
 __construct (array $values, $entity_type)
 
 id ()
 
 uuid ()
 
 isNew ()
 
 enforceIsNew ($value=TRUE)
 
 getEntityTypeId ()
 
 bundle ()
 
 label ()
 
 urlInfo ($rel= 'canonical', array $options=[])
 
 toUrl ($rel= 'canonical', array $options=[])
 
 hasLinkTemplate ($rel)
 
 link ($text=NULL, $rel= 'canonical', array $options=[])
 
 toLink ($text=NULL, $rel= 'canonical', array $options=[])
 
 url ($rel= 'canonical', $options=array())
 
 uriRelationships ()
 
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
 language ()
 
 save ()
 
 delete ()
 
 createDuplicate ()
 
 getEntityType ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 postCreate (EntityStorageInterface $storage)
 
 referencedEntities ()
 
 getCacheContexts ()
 
 getCacheTagsToInvalidate ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 toArray ()
 
 getTypedData ()
 
 __sleep ()
 
 getConfigDependencyKey ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 
- Public Member Functions inherited from EntityViewDisplayInterface
 buildMultiple (array $entities)
 

Static Public Member Functions

static collectRenderDisplays ($entities, $view_mode)
 
static collectRenderDisplay (FieldableEntityInterface $entity, $view_mode)
 
- Static Public Member Functions inherited from ConfigEntityBase
static sort (ConfigEntityInterface $a, ConfigEntityInterface $b)
 
- Static Public Member Functions inherited from Entity
static preCreate (EntityStorageInterface $storage, array &$values)
 
static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 
static load ($id)
 
static loadMultiple (array $ids=NULL)
 
static create (array $values=array())
 

Protected Attributes

 $displayContext = 'view'
 
- Protected Attributes inherited from EntityDisplayBase
 $id
 
 $targetEntityType
 
 $bundle
 
 $fieldDefinitions
 
 $mode = self::CUSTOM_MODE
 
 $status
 
 $content = array()
 
 $hidden = array()
 
 $originalMode
 
 $plugins = array()
 
 $displayContext
 
 $pluginManager
 
 $renderer
 
- Protected Attributes inherited from ConfigEntityBase
 $originalId
 
 $pluginConfigKey
 
 $status = TRUE
 
 $uuid
 
 $langcode = 'en'
 
 $third_party_settings = array()
 
 $_core = []
 
 $trustedData = FALSE
 
- Protected Attributes inherited from Entity
 $entityTypeId
 
 $enforceIsNew
 
 $typedData
 

Additional Inherited Members

- Data Fields inherited from EntityDisplayBase
const CUSTOM_MODE = '_custom'
 
- Protected Member Functions inherited from EntityDisplayBase
 init ()
 
 getFieldDefinition ($field_name)
 
 getFieldDefinitions ()
 
 getPluginRemovedDependencies (array $plugin_dependencies, array $removed_dependencies)
 
 getLogger ()
 
- Protected Member Functions inherited from ConfigEntityBase
 getTypedConfig ()
 
 addDependency ($type, $name)
 
 invalidateTagsOnSave ($update)
 
- Protected Member Functions inherited from Entity
 entityManager ()
 
 entityTypeManager ()
 
 languageManager ()
 
 uuidGenerator ()
 
 linkTemplates ()
 
 urlRouteParameters ($rel)
 
 invalidateTagsOnSave ($update)
 
- Static Protected Member Functions inherited from ConfigEntityBase
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 
static getConfigManager ()
 
- Static Protected Member Functions inherited from Entity
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 

Detailed Description

Configuration entity that contains display options for all components of a rendered entity in a given view mode.

( id = "entity_view_display", label = ("Entity view display"), entity_keys = { "id" = "id", "status" = "status" }, config_export = { "id", "targetEntityType", "bundle", "mode", "content", "hidden", } )

Constructor & Destructor Documentation

__construct ( array  $values,
  $entity_type 
)

{}

References Drupal\service().

Here is the call graph for this function:

Member Function Documentation

build ( FieldableEntityInterface  $entity)

{Builds a renderable array for the components of an entity.See the buildMultiple() method for details.

Parameters
\Drupal\Core\Entity\FieldableEntityInterface$entityThe entity being displayed.
Returns
array A renderable array for the entity.
See Also
::buildMultiple()
}

Implements EntityViewDisplayInterface.

References EntityViewDisplayInterface\buildMultiple().

Here is the call graph for this function:

static collectRenderDisplay ( FieldableEntityInterface  $entity,
  $view_mode 
)
static

Returns the display object used to render an entity.

See the collectRenderDisplays() method for details.

Parameters
\Drupal\Core\Entity\FieldableEntityInterface$entityThe entity being rendered.
string$view_modeThe view mode.
Returns
The display object that should be used to render the entity.
See Also
::collectRenderDisplays()

References EntityInterface\bundle().

Referenced by MetadataGenerator\generateFieldMetadata().

Here is the call graph for this function:

Here is the caller graph for this function:

static collectRenderDisplays (   $entities,
  $view_mode 
)
static

Returns the display objects used to render a set of entities.

Depending on the configuration of the view mode for each bundle, this can be either the display object associated with the view mode, or the 'default' display.

This method should only be used internally when rendering an entity. When assigning suggested display options for a component in a given view mode, entity_get_display() should be used instead, in order to avoid inadvertently modifying the output of other view modes that might happen to use the 'default' display too. Those options will then be effectively applied only if the view mode is configured to use them.

hook_entity_view_display_alter() is invoked on each display, allowing 3rd party code to alter the display options held in the display before they are used to generate render arrays.

Parameters
\Drupal\Core\Entity\FieldableEntityInterface[]$entities The entities being rendered. They should all be of the same entity type.
string$view_modeThe view mode being rendered.
Returns
[] The display objects to use to render the entities, keyed by entity bundle.
See Also
entity_get_display()
hook_entity_view_display_alter()

References Drupal\entityManager(), Drupal\entityQuery(), NestedArray\mergeDeepArray(), and Drupal\moduleHandler().

Referenced by EntityViewBuilder\buildMultiple().

Here is the call graph for this function:

Here is the caller graph for this function:

getPluginCollections ( )

{Gets the plugin collections used by this entity.

Returns
[] An array of plugin collections, keyed by the property name they use to store their configuration.
}

Implements EntityWithPluginCollectionInterface.

References EntityDisplayBase\getComponents(), and EntityDisplayBase\getFieldDefinition().

Here is the call graph for this function:

getRenderer (   $field_name)

{Gets the renderer plugin for a field (e.g. widget, formatter).

Parameters
string$field_nameThe field name.
Returns
|null A widget or formatter plugin or NULL if the field does not exist.
}

Implements EntityDisplayInterface.

References EntityDisplayBase\getComponent(), and EntityDisplayBase\getFieldDefinition().

Here is the call graph for this function:

postSave ( EntityStorageInterface  $storage,
  $update = TRUE 
)

{Acts on a saved entity before the insert or update hook is invoked.Used after the entity is saved, but before invoking the insert or update hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
bool$updateTRUE if the entity has been updated, or FALSE if it has been inserted.
}

Implements EntityInterface.

References Drupal\entityManager().

Here is the call graph for this function:

Field Documentation

$displayContext = 'view'
protected

{}


The documentation for this class was generated from the following file: