You are here

protected function ResourceTypeRepository::getAllBundlesForEntityType in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php \Drupal\jsonapi\ResourceType\ResourceTypeRepository::getAllBundlesForEntityType()

Gets all bundle IDs for a given entity type.

Parameters

string $entity_type_id: The entity type for which to get bundles.

Return value

string[] The bundle IDs.

1 call to ResourceTypeRepository::getAllBundlesForEntityType()
ResourceTypeRepository::getRelatableResourceTypesFromFieldDefinition in core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php
Get relatable resource types from a field definition.

File

core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php, line 507

Class

ResourceTypeRepository
Provides a repository of all JSON:API resource types.

Namespace

Drupal\jsonapi\ResourceType

Code

protected function getAllBundlesForEntityType($entity_type_id) {

  // Ensure all keys are strings because numeric values are allowed as bundle
  // names and "array_keys()" casts "42" to 42.
  return array_map('strval', array_keys($this->entityTypeBundleInfo
    ->getBundleInfo($entity_type_id)));
}