Mercurial > hg > isophonics-drupal-site
annotate core/modules/jsonapi/src/JsonApiResource/ResourceIdentifierInterface.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | af1871eacc83 |
children |
rev | line source |
---|---|
Chris@18 | 1 <?php |
Chris@18 | 2 |
Chris@18 | 3 namespace Drupal\jsonapi\JsonApiResource; |
Chris@18 | 4 |
Chris@18 | 5 /** |
Chris@18 | 6 * An interface for identifying a related resource. |
Chris@18 | 7 * |
Chris@18 | 8 * Implement this interface when an object is a stand-in for an Entity object. |
Chris@18 | 9 * For example, \Drupal\jsonapi\Exception\EntityAccessDeniedHttpException |
Chris@18 | 10 * implements this interface because it often replaces an entity in a JSON:API |
Chris@18 | 11 * Data object. |
Chris@18 | 12 * |
Chris@18 | 13 * @internal JSON:API maintains no PHP API. The API is the HTTP API. This class |
Chris@18 | 14 * may change at any time and could break any dependencies on it. |
Chris@18 | 15 * |
Chris@18 | 16 * @see https://www.drupal.org/project/jsonapi/issues/3032787 |
Chris@18 | 17 * @see jsonapi.api.php |
Chris@18 | 18 */ |
Chris@18 | 19 interface ResourceIdentifierInterface { |
Chris@18 | 20 |
Chris@18 | 21 /** |
Chris@18 | 22 * Gets the resource identifier's ID. |
Chris@18 | 23 * |
Chris@18 | 24 * @return string |
Chris@18 | 25 * A resource ID. |
Chris@18 | 26 */ |
Chris@18 | 27 public function getId(); |
Chris@18 | 28 |
Chris@18 | 29 /** |
Chris@18 | 30 * Gets the resource identifier's JSON:API resource type name. |
Chris@18 | 31 * |
Chris@18 | 32 * @return string |
Chris@18 | 33 * The JSON:API resource type name. |
Chris@18 | 34 */ |
Chris@18 | 35 public function getTypeName(); |
Chris@18 | 36 |
Chris@18 | 37 /** |
Chris@18 | 38 * Gets the resource identifier's JSON:API resource type. |
Chris@18 | 39 * |
Chris@18 | 40 * @return \Drupal\jsonapi\ResourceType\ResourceType |
Chris@18 | 41 * The JSON:API resource type. |
Chris@18 | 42 */ |
Chris@18 | 43 public function getResourceType(); |
Chris@18 | 44 |
Chris@18 | 45 } |