function ResourceTypeRepository::getAllBundlesForEntityType

Same name in other branches
  1. 9 core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php \Drupal\jsonapi\ResourceType\ResourceTypeRepository::getAllBundlesForEntityType()
  2. 10 core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php \Drupal\jsonapi\ResourceType\ResourceTypeRepository::getAllBundlesForEntityType()
  3. 11.x 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 512

Class

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

Namespace

Drupal\jsonapi\ResourceType

Code

protected function getAllBundlesForEntityType($entity_type_id) {
    return array_keys($this->entityTypeBundleInfo
        ->getBundleInfo($entity_type_id));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.