You are here

function entity_get_bundles in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/includes/entity.inc \entity_get_bundles()

Returns the entity bundle info.

Parameters

string|null $entity_type: The entity type whose bundle info should be returned, or NULL for all bundles info. Defaults to NULL.

Return value

array The bundle info for a specific entity type, or all entity types.

Deprecated

in Drupal 8.x-dev and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityManagerInterface::getBundleInfo() for a single bundle, or \Drupal\Core\Entity\EntityManagerInterface::getAllBundleInfo() for all bundles.

See also

\Drupal\Core\Entity\EntityManagerInterface::getBundleInfo()

\Drupal\Core\Entity\EntityManagerInterface::getAllBundleInfo()

12 calls to entity_get_bundles()
Bundle::getValueOptions in core/modules/views/src/Plugin/views/filter/Bundle.php
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
contact_entity_extra_field_info in core/modules/contact/contact.module
Implements hook_entity_extra_field_info().
content_translation_entity_extra_field_info in core/modules/content_translation/content_translation.module
Implements hook_entity_extra_field_info().
EntityDeriver::getDerivativeDefinitions in core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php
Gets the definition of all derivatives of a base plugin.
EntityReferenceAdminTest::testFieldAdminHandler in core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php
Tests the Entity Reference Admin UI.

... See full list

File

core/includes/entity.inc, line 40
Entity API for handling entities like nodes or users.

Code

function entity_get_bundles($entity_type = NULL) {
  if (isset($entity_type)) {
    return \Drupal::entityManager()
      ->getBundleInfo($entity_type);
  }
  else {
    return \Drupal::entityManager()
      ->getAllBundleInfo();
  }
}