프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$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 |
메소드 | 설명 | |
---|---|---|
__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 |
메소드 | 설명 | |
---|---|---|
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 | ||
리턴 | Drest\Service\Action\AbstractAction | $action |
protected getDefaultAction ( ) : Drest\Service\Action\AbstractAction | ||
리턴 | Drest\Service\Action\AbstractAction | $action |
public getDrestManager ( ) : drest\Manager | ||
리턴 | drest\Manager | $dm |
public getEntityManager ( ) : |
||
리턴 | $em |
public getEntityManagerRegistry ( ) : drest\EntityManagerRegistry | ||
리턴 | drest\EntityManagerRegistry |
public getMatchedRoute ( ) : |
||
리턴 | $matched_route |
public getRepresentation ( ) : DrestCommon\Representation\AbstractRepresentation | ||
리턴 | DrestCommon\Representation\AbstractRepresentation |
public getRequest ( ) : DrestCommon\Request\Request | ||
리턴 | DrestCommon\Request\Request | $request |
public getResponse ( ) : DrestCommon\Response\Response | ||
리턴 | DrestCommon\Response\Response | $response |
public getServiceActionRegistry ( ) : Drest\Service\Action\Registry | ||
리턴 | 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 | |
리턴 | 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 |
protected setupRequest ( ) : boolean | ||
리턴 | boolean | $result - if false then fail fast no call to runCallMethod() should be made. |
protected AbstractHandler,DrestCommon\Error\Handler $error_handler | ||
리턴 | DrestCommon\Error\Handler\AbstractHandler |
protected RouteMetaData,Drest\Mapping $matched_route | ||
리턴 |
protected AbstractRepresentation,DrestCommon\Representation $representation | ||
리턴 | DrestCommon\Representation\AbstractRepresentation |