You are here

public static function RestfulBase::controllersInfo in RESTful 7

Returns the default controllers for the entity.

Return value

array Nested array that provides information about what method to call for each route pattern.

1 call to RestfulBase::controllersInfo()
RestfulBase::getControllers in plugins/restful/RestfulBase.php
Get the defined controllers
1 method overrides RestfulBase::controllersInfo()
RestfulEntityBase::controllersInfo in plugins/restful/RestfulEntityBase.php
Overrides \RestfulDataProviderEFQ::controllersInfo().

File

plugins/restful/RestfulBase.php, line 303
Contains RestfulBase.

Class

RestfulBase
Class \RestfulBase

Code

public static function controllersInfo() {

  // Provide sensible defaults for the HTTP methods. These methods (index,
  // create, view, update and delete) are not implemented in this layer but
  // they are guaranteed to exist because we are enforcing that all restful
  // resources are an instance of \RestfulDataProviderInterface.
  return array(
    '' => array(
      // GET returns a list of entities.
      \RestfulInterface::GET => 'index',
      \RestfulInterface::HEAD => 'index',
      // POST
      \RestfulInterface::POST => 'create',
    ),
    // We don't know what the ID looks like, assume that everything is the ID.
    '^.*$' => array(
      \RestfulInterface::GET => 'view',
      \RestfulInterface::HEAD => 'view',
      \RestfulInterface::PUT => 'replace',
      \RestfulInterface::PATCH => 'update',
      \RestfulInterface::DELETE => 'remove',
    ),
  );
}