interface ResourceInterface

Specifies the publicly available methods of a resource plugin.

Hierarchy

Expanded class hierarchy of ResourceInterface

All classes that implement ResourceInterface

File

drupal/core/modules/rest/lib/Drupal/rest/Plugin/ResourceInterface.php, line 15
Contains \Drupal\rest\Plugin\ResourceInterface.

Namespace

Drupal\rest\Plugin
View source
interface ResourceInterface extends PluginInspectionInterface {

  /**
   * Returns a collection of routes with URL path information for the resource.
   *
   * This method determines where a resource is reachable, what path
   * replacements are used, the required HTTP method for the operation etc.
   *
   * @return \Symfony\Component\Routing\RouteCollection
   *   A collection of routes that should be registered for this resource.
   */
  public function routes();

  /**
   * Provides an array of permissions suitable for hook_permission().
   *
   * A resource plugin can define a set of user permissions that are used on the
   * routes for this resource or for other purposes.
   *
   * @return array
   *   The permission array.
   */
  public function permissions();

  /**
   * Returns the available HTTP request methods on this plugin.
   *
   * @return array
   *   The list of supported methods. Example: array('GET', 'POST', 'PATCH').
   */
  public function availableMethods();

}

Members

Namesort descending Modifiers Type Description Overrides
PluginInspectionInterface::getPluginDefinition public function Returns the definition of the plugin implementation. 1
PluginInspectionInterface::getPluginId public function Returns the plugin_id of the plugin instance. 1
ResourceInterface::availableMethods public function Returns the available HTTP request methods on this plugin. 1
ResourceInterface::permissions public function Provides an array of permissions suitable for hook_permission(). 1
ResourceInterface::routes public function Returns a collection of routes with URL path information for the resource. 1