function entity_get_bundles

Returns the defined bundles for the given entity type.

Parameters

string $entity_type: The entity type whose bundles should be returned.

Return value

array An array containing the bundle names or the entity type name itself if no bundle is defined.

2 calls to entity_get_bundles()
translation_entity_enabled in drupal/core/modules/translation_entity/translation_entity.module
Determines whether the given entity type is translatable.
translation_entity_field_extra_fields in drupal/core/modules/translation_entity/translation_entity.module
Implements hook_field_extra_fields().

File

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

Code

function entity_get_bundles($entity_type) {
  $entity_info = entity_get_info($entity_type);
  return isset($entity_info['bundles']) ? array_keys($entity_info['bundles']) : array(
    $entity_type,
  );
}