public function EntityDisplayRepository::getViewModeOptionsByBundle

public EntityDisplayRepository::getViewModeOptionsByBundle($entity_type_id, $bundle)

Returns an array of enabled view mode options by bundle.

Parameters

string $entity_type_id: The entity type whose view mode options should be returned.

string $bundle: The name of the bundle.

Return value

array An array of view mode labels, keyed by the display mode ID.

Overrides EntityDisplayRepositoryInterface::getViewModeOptionsByBundle

File

core/lib/Drupal/Core/Entity/EntityDisplayRepository.php, line 167

Class

EntityDisplayRepository
Provides a repository for entity display objects (view modes and form modes).

Namespace

Drupal\Core\Entity

Code

public function getViewModeOptionsByBundle($entity_type_id, $bundle) {
  return $this->getDisplayModeOptionsByBundle('view_mode', $entity_type_id, $bundle);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityDisplayRepository.php/function/EntityDisplayRepository::getViewModeOptionsByBundle/8.1.x