EntityViewDisplay::collectRenderDisplay

public static EntityViewDisplay::collectRenderDisplay(FieldableEntityInterface $entity, $view_mode)

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()

File

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

Class

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

Namespace

Drupal\Core\Entity\Entity

Code

public static function collectRenderDisplay(FieldableEntityInterface $entity, $view_mode) {
  $displays = static::collectRenderDisplays(array($entity), $view_mode);
  return $displays[$entity->bundle()];
}
doc_Drupal
2016-10-29 09:08:55
Comments
Leave a Comment

Please login to continue.