interface ResourceTypeRepositoryInterface (View source)

internal  JSON:API maintains no PHP API since its API is the HTTP API. This class may change at any time and this will break any dependencies on it.
 

Provides a repository of all JSON:API resource types.

Methods

all()

Gets all JSON:API resource types.

get(string $entity_type_id, string $bundle)

Gets a specific JSON:API resource type based on entity type ID and bundle.

getByTypeName(string $type_name)

Gets a specific JSON:API resource type based on a supplied typename.

Details

ResourceType[] all()

Gets all JSON:API resource types.

Return Value

ResourceType[]

The set of all JSON:API resource types in this Drupal instance.

ResourceType get(string $entity_type_id, string $bundle)

Gets a specific JSON:API resource type based on entity type ID and bundle.

Parameters

string $entity_type_id

The entity type ID.

string $bundle

The ID for the bundle to find. If the entity type does not have a bundle, then the entity type ID again.

Return Value

ResourceType

The requested JSON:API resource type, if it exists. NULL otherwise.

See also

EntityInterface::bundle

ResourceType|null getByTypeName(string $type_name)

Gets a specific JSON:API resource type based on a supplied typename.

Parameters

string $type_name

The public typename of a JSON:API resource.

Return Value

ResourceType|null

The resource type, or NULL if none found.