You are here

public function Discovery::controllersInfo in RESTful 7.2

@inheritDoc

Overrides Resource::controllersInfo

File

src/Plugin/resource/Discovery.php, line 93
Contains \Drupal\restful\Plugin\resource\Discovery

Class

Discovery
Class Discovery @package Drupal\restful_example\Plugin\Resource

Namespace

Drupal\restful\Plugin\resource

Code

public function controllersInfo() {
  return array(
    '' => array(
      // GET returns a list of entities.
      RequestInterface::METHOD_GET => 'index',
      RequestInterface::METHOD_HEAD => 'index',
    ),
    // We don't know what the ID looks like, assume that everything is the ID.
    '^.*$' => array(
      RequestInterface::METHOD_GET => 'view',
      RequestInterface::METHOD_HEAD => 'view',
      RequestInterface::METHOD_PUT => array(
        'callback' => 'replace',
        'access callback' => 'resourceManipulationAccess',
      ),
      RequestInterface::METHOD_DELETE => array(
        'callback' => 'remove',
        'access callback' => 'resourceManipulationAccess',
      ),
    ),
  );
}