interface ResourceInterface implements PluginInspectionInterface (View source)

Specifies the publicly available methods of a resource plugin.

Methods

string
getPluginId()

Gets the plugin_id of the plugin instance.

array
getPluginDefinition()

Gets the definition of the plugin implementation.

RouteCollection
routes()

Returns a collection of routes with URL path information for the resource.

array
permissions()

Provides an array of permissions suitable for .permissions.yml files.

array
availableMethods()

Returns the available HTTP request methods on this plugin.

Details

string getPluginId()

Gets the plugin_id of the plugin instance.

Return Value

string

The plugin_id of the plugin instance.

array getPluginDefinition()

Gets the definition of the plugin implementation.

Return Value

array

The plugin definition, as returned by the discovery object used by the plugin manager.

RouteCollection routes()

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 Value

RouteCollection

A collection of routes that should be registered for this resource.

array permissions()

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 Value

array

The permission array.

array availableMethods()

Returns the available HTTP request methods on this plugin.

Return Value

array

The list of supported methods. Example: array('GET', 'POST', 'PATCH').