interface ResourceIdentifierInterface (View source)

internal  JSON:API maintains no PHP API. The API is the HTTP API. This class may change at any time and could break any dependencies on it.
 

An interface for identifying a related resource.

Implement this interface when an object is a stand-in for an Entity object. For example, \Drupal\jsonapi\Exception\EntityAccessDeniedHttpException implements this interface because it often replaces an entity in a JSON:API Data object.

Methods

string
getId()

Gets the resource identifier's ID.

string
getTypeName()

Gets the resource identifier's JSON:API resource type name.

getResourceType()

Gets the resource identifier's JSON:API resource type.

Details

string getId()

Gets the resource identifier's ID.

Return Value

string

A resource ID.

string getTypeName()

Gets the resource identifier's JSON:API resource type name.

Return Value

string

The JSON:API resource type name.

ResourceType getResourceType()

Gets the resource identifier's JSON:API resource type.

Return Value

ResourceType

The JSON:API resource type.