Zend\Mvc\Controller\AbstractRestfulController
Abstract RESTful controller
Synopsis
class AbstractRestfulController
extends AbstractController
{
- // constants
- const CONTENT_TYPE_JSON = 'json';
- // members
- protected string $eventIdentifier;
- protected array $contentTypes;
- protected string $identifierName;
- protected int $jsonDecodeType;
- protected array $customHttpMethodsMap;
- // Inherited members from AbstractController
- protected PluginManager $plugins;
- protected RequestInterface $request;
- protected ResponseInterface $response;
- protected EventInterface $event;
- protected EventManagerInterface $events;
- protected ServiceLocatorInterface $serviceLocator;
- protected string $eventIdentifier;
- // methods
- public self setIdentifierName()
- public string getIdentifierName()
- public mixed create()
- public mixed delete()
- public mixed deleteList()
- public mixed get()
- public mixed getList()
- public mixed head()
- public mixed options()
- public void patch()
- public mixed replaceList()
- public mixed patchList()
- public mixed update()
- public array notFoundAction()
- public mixed|Response dispatch()
- public mixed onDispatch()
- public mixed processPostData()
- public bool requestHasContentType()
- public AbstractRestfulController addHttpMethodHandler()
- protected false|mixed getIdentifier()
- protected object|string|array processBodyContent()
- // Inherited methods from AbstractController
- public abstract mixed onDispatch()
- public Response|mixed dispatch()
- public RequestInterface getRequest()
- public ResponseInterface getResponse()
- public AbstractController setEventManager()
- public EventManagerInterface getEventManager()
- public void setEvent()
- public MvcEvent getEvent()
- public void setServiceLocator()
- public ServiceLocatorInterface getServiceLocator()
- public PluginManager getPluginManager()
- public AbstractController setPluginManager()
- public mixed plugin()
- public mixed __call()
- protected void attachDefaultListeners()
- public static string getMethodFromAction()
Hierarchy
Tasks
Line | Task |
---|---|
311+ | try-catch in "patch" for patchList should be removed in the future |
315 | Determine requirements for when route match is missing. |
Constants
Name | Value |
---|---|
CONTENT_TYPE_JSON | 'json' |
Members
protected
- $contentTypes — array
- $customHttpMethodsMap
—
array
Map of custom HTTP methods and their handlers - $event — Zend\EventManager\EventInterface
- $eventIdentifier — string
- $eventIdentifier — string
- $events — Zend\EventManager\EventManagerInterface
- $identifierName
—
string
Name of request or query parameter containing identifier - $jsonDecodeType — int
- $plugins — Zend\Mvc\Controller\PluginManager
- $request — Zend\Stdlib\RequestInterface
- $response — Zend\Stdlib\ResponseInterface
- $serviceLocator — Zend\ServiceManager\ServiceLocatorInterface
Methods
protected
- getIdentifier() — Retrieve the identifier, if any
- processBodyContent() — Process the raw body content
public
- addHttpMethodHandler() — Register a handler for a custom HTTP method
- create() — Create a new resource
- delete() — Delete an existing resource
- deleteList() — Delete the entire resource collection
- dispatch() — Dispatch a request
- get() — Return single resource
- getIdentifierName() — Retrieve the route match/query parameter name containing the identifier
- getList() — Return list of resources
- head() — Retrieve HEAD metadata for the resource
- notFoundAction() — Basic functionality for when a page is not available
- onDispatch() — Handle the request
- options() — Respond to the OPTIONS method
- patch() — Respond to the PATCH method
- patchList() — Modify a resource collection withou completely replacing it
- processPostData() — Process post data and call create
- replaceList() — Replace an entire resource collection
- requestHasContentType() — Check if request has certain content type
- setIdentifierName() — Set the route match/query parameter name containing the identifier
- update() — Update an existing resource
Inherited from Zend\Mvc\Controller\AbstractController
protected
- attachDefaultListeners() — Register the default events for this controller
public
- __call() — Method overloading: return/call plugins
- dispatch() — Dispatch a request
- getEvent() — Get the attached event
- getEventManager() — Retrieve the event manager
- getMethodFromAction() — Transform an "action" token into a method name
- getPluginManager() — Get plugin manager
- getRequest() — Get request object
- getResponse() — Get response object
- getServiceLocator() — Retrieve serviceManager instance
- onDispatch() — Execute the request
- plugin() — Get plugin instance
- setEvent() — Set an event to use during dispatch
- setEventManager() — Set the event manager instance used by this context
- setPluginManager() — Set plugin manager
- setServiceLocator() — Set serviceManager instance