Свойство | Type | Description | |
---|---|---|---|
$dm | drest\Manager | Drest Manager | |
$error_handler | DrestCommon\Error\Handler\AbstractHandler | The error handler instance | |
$matched_route | When a route object is matched, it's injected into the service class | ||
$representation | DrestCommon\Representation\AbstractRepresentation | A representation instance determined either from configuration or client media accept type - can be null if none matched Note this will be present on both a fetch (GET) request and on a push (POST / PUT) request if using the drest client | |
$service_action_registry | Drest\Service\Action\Registry | Service Action Registry |
Méthode | Description | |
---|---|---|
__construct ( drest\Manager $dm, Drest\Service\Action\Registry $service_action_registry ) | Initialise a new instance of a Drest service | |
getDrestManager ( ) : drest\Manager | Get the Drest Manager | |
getEntityManager ( ) : |
Get the entity manager This will return the default manager, to choose a specific one use getEntityManagerRegistry() | |
getEntityManagerRegistry ( ) : drest\EntityManagerRegistry | Get the entity manager registry | |
getMatchedRoute ( ) : |
Get the route object that was matched | |
getRepresentation ( ) : DrestCommon\Representation\AbstractRepresentation | Get the predetermined representation | |
getRequest ( ) : DrestCommon\Request\Request | Get the request object | |
getResponse ( ) : DrestCommon\Response\Response | Get the response object | |
getServiceActionRegistry ( ) : Drest\Service\Action\Registry | Get the service action registry | |
handleError ( Exception $e, integer $defaultResponseCode = 500, DrestCommon\Error\Response\ResponseInterface $errorDocument = null ) : DrestCommon\ResultSet | Handle an error - set the resulting error document to the response object | |
renderDeterminedRepresentation ( DrestCommon\ResultSet $resultSet ) | Write out as result set on the representation object that was determined - if no representation has been determined - defaults to text | |
runCallMethod ( ) | Run the call method required on this service object | |
setErrorHandler ( DrestCommon\Error\Handler\AbstractHandler $error_handler ) | Set the error handler object | |
setMatchedRoute ( |
Set the matched route object | |
setRepresentation ( DrestCommon\Representation\AbstractRepresentation $representation ) | Set any predetermined representation instance | |
setUpAndRunRequest ( ) | Set up and run the required call method |
Méthode | Description | |
---|---|---|
getActionInstance ( ) : Drest\Service\Action\AbstractAction | Get an instance of the action class to be used | |
getDefaultAction ( ) : Drest\Service\Action\AbstractAction | Gets an instance of the "default" action based of request information | |
setupRequest ( ) : boolean | Called on successful routing of a service call Prepares the service to a request to be rendered |
public __construct ( drest\Manager $dm, Drest\Service\Action\Registry $service_action_registry ) | ||
$dm | drest\Manager | - The Drest Manager object |
$service_action_registry | Drest\Service\Action\Registry | - registry use to look up service actions |
protected getActionInstance ( ) : Drest\Service\Action\AbstractAction | ||
Résultat | Drest\Service\Action\AbstractAction | $action |
protected getDefaultAction ( ) : Drest\Service\Action\AbstractAction | ||
Résultat | Drest\Service\Action\AbstractAction | $action |
public getDrestManager ( ) : drest\Manager | ||
Résultat | drest\Manager | $dm |
public getEntityManager ( ) : |
||
Résultat | $em |
public getEntityManagerRegistry ( ) : drest\EntityManagerRegistry | ||
Résultat | drest\EntityManagerRegistry |
public getMatchedRoute ( ) : |
||
Résultat | $matched_route |
public getRepresentation ( ) : DrestCommon\Representation\AbstractRepresentation | ||
Résultat | DrestCommon\Representation\AbstractRepresentation |
public getRequest ( ) : DrestCommon\Request\Request | ||
Résultat | DrestCommon\Request\Request | $request |
public getResponse ( ) : DrestCommon\Response\Response | ||
Résultat | DrestCommon\Response\Response | $response |
public getServiceActionRegistry ( ) : Drest\Service\Action\Registry | ||
Résultat | Drest\Service\Action\Registry | $service_action_registry |
public handleError ( Exception $e, integer $defaultResponseCode = 500, DrestCommon\Error\Response\ResponseInterface $errorDocument = null ) : DrestCommon\ResultSet | ||
$e | Exception | |
$defaultResponseCode | integer | the default response code to use if no match on exception type occurs |
$errorDocument | DrestCommon\Error\Response\ResponseInterface | |
Résultat | DrestCommon\ResultSet | the error result set |
public renderDeterminedRepresentation ( DrestCommon\ResultSet $resultSet ) | ||
$resultSet | DrestCommon\ResultSet |
final public runCallMethod ( ) |
public setErrorHandler ( DrestCommon\Error\Handler\AbstractHandler $error_handler ) | ||
$error_handler | DrestCommon\Error\Handler\AbstractHandler |
public setMatchedRoute ( |
||
$matched_route |
public setRepresentation ( DrestCommon\Representation\AbstractRepresentation $representation ) | ||
$representation | DrestCommon\Representation\AbstractRepresentation |
public setUpAndRunRequest ( ) |
protected setupRequest ( ) : boolean | ||
Résultat | boolean | $result - if false then fail fast no call to runCallMethod() should be made. |
protected AbstractHandler,DrestCommon\Error\Handler $error_handler | ||
Résultat | DrestCommon\Error\Handler\AbstractHandler |
protected RouteMetaData,Drest\Mapping $matched_route | ||
Résultat |
protected AbstractRepresentation,DrestCommon\Representation $representation | ||
Résultat | DrestCommon\Representation\AbstractRepresentation |