Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ResourceIdentifierInterface.php

interface ResourceIdentifierInterface

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.

@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.

Hierarchy

  • interface \Drupal\jsonapi\JsonApiResource\ResourceIdentifierInterface

Expanded class hierarchy of ResourceIdentifierInterface

All classes that implement ResourceIdentifierInterface

See also

https://www.drupal.org/project/drupal/issues/3032787

jsonapi.api.php

3 files declare their use of ResourceIdentifierInterface
EntityAccessDeniedHttpException.php in core/modules/jsonapi/src/Exception/EntityAccessDeniedHttpException.php
EntityReferenceFieldNormalizer.php in core/modules/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php
IncludeResolver.php in core/modules/jsonapi/src/IncludeResolver.php

File

core/modules/jsonapi/src/JsonApiResource/ResourceIdentifierInterface.php, line 19

Namespace

Drupal\jsonapi\JsonApiResource
View source
interface ResourceIdentifierInterface {
    
    /**
     * Gets the resource identifier's ID.
     *
     * @return string
     *   A resource ID.
     */
    public function getId();
    
    /**
     * Gets the resource identifier's JSON:API resource type name.
     *
     * @return string
     *   The JSON:API resource type name.
     */
    public function getTypeName();
    
    /**
     * Gets the resource identifier's JSON:API resource type.
     *
     * @return \Drupal\jsonapi\ResourceType\ResourceType
     *   The JSON:API resource type.
     */
    public function getResourceType();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
ResourceIdentifierInterface::getId public function Gets the resource identifier's ID. 1
ResourceIdentifierInterface::getResourceType public function Gets the resource identifier's JSON:API resource type. 1
ResourceIdentifierInterface::getTypeName public function Gets the resource identifier's JSON:API resource type name. 1

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal