function EntityManager::getViewDisplay

Overrides EntityDisplayRepositoryInterface::getViewDisplay

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::getViewDisplay() instead.

File

core/lib/Drupal/Core/Entity/EntityManager.php, line 898

Class

EntityManager
Provides a wrapper around many other services relating to entities.

Namespace

Drupal\Core\Entity

Code

public function getViewDisplay($entity_type, $bundle, $view_mode = self::DEFAULT_DISPLAY_MODE) {
    @trigger_error('EntityManager::getViewDisplay() is deprecated in drupal:8.8.0 and will be removed before Drupal 9.0.0. Use \\Drupal::service(\'entity_display.repository\')->getViewDisplay() instead.', E_USER_DEPRECATED);
    return $this->container
        ->get('entity_display.repository')
        ->getViewDisplay($entity_type, $bundle, $view_mode);
}

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