PHP Class Drahak\Restful\Application\UI\ResourcePresenter

Author: Drahomír Hanák
Inheritance: extends Nette\Application\UI\Presenter, implements Drahak\Restful\Application\IResourcePresenter
Show file Open project: drahak/restful Class Usage Examples

Protected Properties

Property Type Description
$authentication Drahak\Restful\Security\AuthenticationContext
$requestFilter Drahak\Restful\Utils\RequestFilter
$resource Drahak\Restful\IResource
$resourceFactory Drahak\Restful\IResourceFactory
$responseFactory Drahak\Restful\Application\IResponseFactory

Public Methods

Method Description
checkRequirements ( $element ) Check security and other presenter requirements
formatValidateMethod ( $action ) Validate action method
getInput ( ) : Drahak\Restful\Http\IInput Get input
injectDrahakRestful ( Drahak\Restful\Application\IResponseFactory $responseFactory, Drahak\Restful\IResourceFactory $resourceFactory, Drahak\Restful\Security\AuthenticationContext $authentication, InputFactory $inputFactory, Drahak\Restful\Utils\RequestFilter $requestFilter ) Inject Drahak Restful
link ( string $destination, array $args = [], string $rel = Link::SELF ) : Drahak\Restful\Resource\Link Create resource link representation object
sendResource ( string $contentType = NULL ) : Nette\Application\IResponse Get REST API response

Protected Methods

Method Description
beforeRender ( ) On before render
createErrorResource ( Exception | Throwable $e ) : Drahak\Restful\IResource Create error response from exception
sendErrorResource ( Exception | Throwable $e, $contentType = NULL ) Send error resource to output
startup ( ) Presenter startup

Method Details

beforeRender() protected method

On before render
protected beforeRender ( )

checkRequirements() public method

Check security and other presenter requirements
public checkRequirements ( $element )
$element

createErrorResource() protected method

Create error response from exception
protected createErrorResource ( Exception | Throwable $e ) : Drahak\Restful\IResource
$e Exception | Throwable
return Drahak\Restful\IResource

formatValidateMethod() public static method

Validate action method
public static formatValidateMethod ( $action )

getInput() public method

Get input
public getInput ( ) : Drahak\Restful\Http\IInput
return Drahak\Restful\Http\IInput

injectDrahakRestful() final public method

Inject Drahak Restful
final public injectDrahakRestful ( Drahak\Restful\Application\IResponseFactory $responseFactory, Drahak\Restful\IResourceFactory $resourceFactory, Drahak\Restful\Security\AuthenticationContext $authentication, InputFactory $inputFactory, Drahak\Restful\Utils\RequestFilter $requestFilter )
$responseFactory Drahak\Restful\Application\IResponseFactory
$resourceFactory Drahak\Restful\IResourceFactory
$authentication Drahak\Restful\Security\AuthenticationContext
$inputFactory Drahak\Restful\Http\InputFactory
$requestFilter Drahak\Restful\Utils\RequestFilter

sendErrorResource() protected method

Send error resource to output
protected sendErrorResource ( Exception | Throwable $e, $contentType = NULL )
$e Exception | Throwable

sendResource() public method

Get REST API response
public sendResource ( string $contentType = NULL ) : Nette\Application\IResponse
$contentType string
return Nette\Application\IResponse

startup() protected method

Presenter startup
protected startup ( )

Property Details

$authentication protected property

protected AuthenticationContext,Drahak\Restful\Security $authentication
return Drahak\Restful\Security\AuthenticationContext

$requestFilter protected property

protected RequestFilter,Drahak\Restful\Utils $requestFilter
return Drahak\Restful\Utils\RequestFilter

$resource protected property

protected IResource,Drahak\Restful $resource
return Drahak\Restful\IResource

$resourceFactory protected property

protected IResourceFactory,Drahak\Restful $resourceFactory
return Drahak\Restful\IResourceFactory

$responseFactory protected property

protected IResponseFactory,Drahak\Restful\Application $responseFactory
return Drahak\Restful\Application\IResponseFactory