entity_get_bundles($entity_type = NULL)
Returns the entity bundle info.
string|null $entity_type: The entity type whose bundle info should be returned, or NULL for all bundles info. Defaults to NULL.
array The bundle info for a specific entity type, or all entity types.
in Drupal 8.x-dev and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo() for a single bundle, or \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo() for all bundles.
\Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo()
\Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo()
function entity_get_bundles($entity_type = NULL) { if (isset($entity_type)) { return \Drupal::entityManager()->getBundleInfo($entity_type); } else { return \Drupal::entityManager()->getAllBundleInfo(); } }
© 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!includes!entity.inc/function/entity_get_bundles/8.1.x