PHP Class WellCommerce\Bundle\ApiBundle\Controller\ApiController

Author: Adam Piotrowski ([email protected])
Inheritance: extends WellCommerce\Bundle\CoreBundle\Controller\AbstractController
Exibir arquivo Open project: wellcommerce/wellcommerce

Protected Properties

Property Type Description
$requestHandlerCollection WellCommerce\Bundle\ApiBundle\Request\RequestHandlerCollection

Public Methods

Method Description
__construct ( RequestHandlerCollection $requestHandlerCollection ) ApiController constructor.
createResourceAction ( Request $request, string $resourceType ) : Response
deleteResourceAction ( Request $request, string $resourceType, integer $identifier ) : Response
getResourceAction ( Request $request, string $resourceType, integer $identifier ) : Response
indexAction ( ) : Response
listResourceAction ( Request $request, string $resourceType ) : Response
updateResourceAction ( Request $request, string $resourceType, integer $identifier ) : Response

Protected Methods

Method Description
getRequestHandler ( string $resourceType ) : WellCommerce\Bundle\ApiBundle\Request\RequestHandlerInterface
jsonErrorResponse ( Exception $e ) : Symfony\Component\HttpFoundation\JsonResponse

Method Details

__construct() public method

ApiController constructor.
public __construct ( RequestHandlerCollection $requestHandlerCollection )
$requestHandlerCollection WellCommerce\Bundle\ApiBundle\Request\RequestHandlerCollection

createResourceAction() public method

public createResourceAction ( Request $request, string $resourceType ) : Response
$request Symfony\Component\HttpFoundation\Request
$resourceType string
return Symfony\Component\HttpFoundation\Response

deleteResourceAction() public method

public deleteResourceAction ( Request $request, string $resourceType, integer $identifier ) : Response
$request Symfony\Component\HttpFoundation\Request
$resourceType string
$identifier integer
return Symfony\Component\HttpFoundation\Response

getRequestHandler() protected method

protected getRequestHandler ( string $resourceType ) : WellCommerce\Bundle\ApiBundle\Request\RequestHandlerInterface
$resourceType string
return WellCommerce\Bundle\ApiBundle\Request\RequestHandlerInterface

getResourceAction() public method

public getResourceAction ( Request $request, string $resourceType, integer $identifier ) : Response
$request Symfony\Component\HttpFoundation\Request
$resourceType string
$identifier integer
return Symfony\Component\HttpFoundation\Response

indexAction() public method

public indexAction ( ) : Response
return Symfony\Component\HttpFoundation\Response

jsonErrorResponse() protected method

protected jsonErrorResponse ( Exception $e ) : Symfony\Component\HttpFoundation\JsonResponse
$e Exception
return Symfony\Component\HttpFoundation\JsonResponse

listResourceAction() public method

public listResourceAction ( Request $request, string $resourceType ) : Response
$request Symfony\Component\HttpFoundation\Request
$resourceType string
return Symfony\Component\HttpFoundation\Response

updateResourceAction() public method

public updateResourceAction ( Request $request, string $resourceType, integer $identifier ) : Response
$request Symfony\Component\HttpFoundation\Request
$resourceType string
$identifier integer
return Symfony\Component\HttpFoundation\Response

Property Details

$requestHandlerCollection protected_oe property

protected RequestHandlerCollection,WellCommerce\Bundle\ApiBundle\Request $requestHandlerCollection
return WellCommerce\Bundle\ApiBundle\Request\RequestHandlerCollection