Skip to content
Snippets Groups Projects
Select Git revision
  • 11.x
  • 11.2.x protected
  • 10.6.x protected
  • 10.5.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
40 results

ResourceInterface.php

Blame
  • Lee Rowlands's avatar
    Issue #3454159 by quietone, smustgrave, nod_: Convert use of array() syntax in sentences
    Lee Rowlands authored
    ef6790f7
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ResourceInterface.php 1.51 KiB
    <?php
    
    namespace Drupal\rest\Plugin;
    
    use Drupal\Component\Plugin\PluginInspectionInterface;
    
    /**
     * Specifies the publicly available methods of a resource plugin.
     *
     * @see \Drupal\rest\Annotation\RestResource
     * @see \Drupal\rest\Plugin\Type\ResourcePluginManager
     * @see \Drupal\rest\Plugin\ResourceBase
     * @see plugin_api
     *
     * @ingroup third_party
     */
    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 .permissions.yml files.
       *
       * A resource plugin can define a set of user permissions that are used on the
       * routes for this resource or for other purposes.
       *
       * It is not required for a resource plugin to specify permissions: if they
       * have their own access control mechanism, they can use that, and return the
       * empty array.
       *
       * @return array
       *   The permission array.
       */
      public function permissions();
    
      /**
       * Returns the available HTTP request methods on this plugin.
       *
       * @return array
       *   The list of supported methods. For example, ['GET', 'POST', 'PATCH'].
       */
      public function availableMethods();
    
    }