Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / rest / src / Plugin / ResourceInterface.php
1 <?php
2
3 namespace Drupal\rest\Plugin;
4
5 use Drupal\Component\Plugin\PluginInspectionInterface;
6
7 /**
8  * Specifies the publicly available methods of a resource plugin.
9  *
10  * @see \Drupal\rest\Annotation\RestResource
11  * @see \Drupal\rest\Plugin\Type\ResourcePluginManager
12  * @see \Drupal\rest\Plugin\ResourceBase
13  * @see plugin_api
14  *
15  * @ingroup third_party
16  */
17 interface ResourceInterface extends PluginInspectionInterface {
18
19   /**
20    * Returns a collection of routes with URL path information for the resource.
21    *
22    * This method determines where a resource is reachable, what path
23    * replacements are used, the required HTTP method for the operation etc.
24    *
25    * @return \Symfony\Component\Routing\RouteCollection
26    *   A collection of routes that should be registered for this resource.
27    */
28   public function routes();
29
30   /**
31    * Provides an array of permissions suitable for .permissions.yml files.
32    *
33    * A resource plugin can define a set of user permissions that are used on the
34    * routes for this resource or for other purposes.
35    *
36    * It is not required for a resource plugin to specify permissions: if they
37    * have their own access control mechanism, they can use that, and return the
38    * empty array.
39    *
40    * @return array
41    *   The permission array.
42    */
43   public function permissions();
44
45   /**
46    * Returns the available HTTP request methods on this plugin.
47    *
48    * @return array
49    *   The list of supported methods. Example: array('GET', 'POST', 'PATCH').
50    */
51   public function availableMethods();
52
53 }