CommonGateway\CoreBundle\Service\EndpointService

This service handles calls on the ZZ endpoint (or in other words abstract routing).

Methods

Name Description
__construct The constructor sets al needed variables.
decodeBody Decodes the body of the request based upon the content-type header, accept header or endpoint default.
getAcceptType Gets the accept type based on the request.
getEndpoint Gets the endpoint based on the request.
handleRequest Handle the request afther it commes in through the ZZ controller.

EndpointService::__construct

Description

public __construct (\EntityManagerInterface $entityManager, \SerializerInterface $serializer, \RequestService $requestService, \EventDispatcherInterface $eventDispatcher)

The constructor sets al needed variables.

Parameters

  • (\EntityManagerInterface) $entityManager : The enitymanger
  • (\SerializerInterface) $serializer : The serializer
  • (\RequestService) $requestService : The request service
  • (\EventDispatcherInterface) $eventDispatcher : The event dispatcher

Return Values

void


EndpointService::decodeBody

Description

public decodeBody (void)

Decodes the body of the request based upon the content-type header, accept header or endpoint default.

Parameters

This function has no parameters.

Return Values

array


EndpointService::getAcceptType

Description

public getAcceptType (void)

Gets the accept type based on the request.

This method breaks complexity rules but since a switch is the most efficent and performent way to do this we made a design decicion to allow it

Parameters

This function has no parameters.

Return Values

string

The accept type


EndpointService::getEndpoint

Description

public getEndpoint (void)

Gets the endpoint based on the request.

Parameters

This function has no parameters.

Return Values

\Endpoint

The found endpoint

Throws Exceptions

\Exception


EndpointService::handleRequest

Description

public handleRequest (\Request $request)

Handle the request afther it commes in through the ZZ controller.

Parameters

  • (\Request) $request : The inbound request

Return Values

\Response

Throws Exceptions

\Exception