diff core/modules/jsonapi/src/JsonApiResource/ResourceIdentifierInterface.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/jsonapi/src/JsonApiResource/ResourceIdentifierInterface.php	Thu May 09 15:33:08 2019 +0100
@@ -0,0 +1,45 @@
+<?php
+
+namespace Drupal\jsonapi\JsonApiResource;
+
+/**
+ * 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.
+ *
+ * @see https://www.drupal.org/project/jsonapi/issues/3032787
+ * @see jsonapi.api.php
+ */
+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();
+
+}