You are here

interface ResourceTypeRepositoryInterface in JSON:API 8

Same name and namespace in other branches
  1. 8.2 src/ResourceType/ResourceTypeRepositoryInterface.php \Drupal\jsonapi\ResourceType\ResourceTypeRepositoryInterface

Provides a repository of all JSON API resource types.

@internal

Hierarchy

Expanded class hierarchy of ResourceTypeRepositoryInterface

All classes that implement ResourceTypeRepositoryInterface

14 files declare their use of ResourceTypeRepositoryInterface
EntityNormalizer.php in src/Normalizer/EntityNormalizer.php
EntityReferenceFieldNormalizer.php in src/Normalizer/EntityReferenceFieldNormalizer.php
EntityResource.php in src/Controller/EntityResource.php
EntityToJsonApi.php in src/EntityToJsonApi.php
EntryPoint.php in src/Controller/EntryPoint.php

... See full list

File

src/ResourceType/ResourceTypeRepositoryInterface.php, line 10

Namespace

Drupal\jsonapi\ResourceType
View source
interface ResourceTypeRepositoryInterface {

  /**
   * Gets all JSON API resource types.
   *
   * @return \Drupal\jsonapi\ResourceType\ResourceType[]
   *   The set of all JSON API resource types in this Drupal instance.
   */
  public function all();

  /**
   * Gets a specific JSON API resource type based on entity type ID and bundle.
   *
   * @param string $entity_type_id
   *   The entity type id.
   * @param string $bundle
   *   The id for the bundle to find.
   *
   * @return \Drupal\jsonapi\ResourceType\ResourceType
   *   The requested JSON API resource type, if it exists. NULL otherwise.
   */
  public function get($entity_type_id, $bundle);

  /**
   * Gets a specific JSON API resource type based on a supplied typename.
   *
   * @param string $type_name
   *   The public typename of a JSON API resource.
   *
   * @return \Drupal\jsonapi\ResourceType\ResourceType|null
   *   The resource type, or NULL if none found.
   */
  public function getByTypeName($type_name);

}

Members

Namesort descending Modifiers Type Description Overrides
ResourceTypeRepositoryInterface::all public function Gets all JSON API resource types. 1
ResourceTypeRepositoryInterface::get public function Gets a specific JSON API resource type based on entity type ID and bundle. 1
ResourceTypeRepositoryInterface::getByTypeName public function Gets a specific JSON API resource type based on a supplied typename. 1