Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityViewDisplay.php

function EntityViewDisplay::collectRenderDisplay

Returns the display object used to render an entity.

See the collectRenderDisplays() method for details.

Parameters

\Drupal\Core\Entity\FieldableEntityInterface $entity: The entity being rendered.

string $view_mode: The view mode.

Return value

\Drupal\Core\Entity\Display\EntityViewDisplayInterface The display object that should be used to render the entity.

See also

\Drupal\Core\Entity\Entity\EntityViewDisplay::collectRenderDisplays()

3 calls to EntityViewDisplay::collectRenderDisplay()
EntityViewBuilder::getSingleFieldDisplay in core/lib/Drupal/Core/Entity/EntityViewBuilder.php
Gets an EntityViewDisplay for rendering an individual field.
LayoutBuilderIsActiveCacheContext::getDisplay in core/modules/layout_builder/src/Cache/LayoutBuilderIsActiveCacheContext.php
Returns the entity view display for a given entity type and view mode.
LayoutEntityHelperTrait::getSectionStorageForEntity in core/modules/layout_builder/src/LayoutEntityHelperTrait.php
Gets the section storage for an entity.

File

core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php, line 177

Class

EntityViewDisplay
Configuration entity.

Namespace

Drupal\Core\Entity\Entity

Code

public static function collectRenderDisplay(FieldableEntityInterface $entity, $view_mode) {
    $displays = static::collectRenderDisplays([
        $entity,
    ], $view_mode);
    return $displays[$entity->bundle()];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal