You are here

function entity_entity_bundle_info in Entity API 8

Implements hook_entity_bundle_info().

File

./entity.module, line 94
Provides expanded entity APIs.

Code

function entity_entity_bundle_info() {
  $bundles = [];
  foreach (entity_get_bundle_plugin_entity_types() as $entity_type) {

    /** @var \Drupal\entity\BundlePlugin\BundlePluginHandler $bundle_handler */
    $bundle_handler = \Drupal::entityTypeManager()
      ->getHandler($entity_type
      ->id(), 'bundle_plugin');
    $bundles[$entity_type
      ->id()] = $bundle_handler
      ->getBundleInfo();
  }
  return $bundles;
}