PHP Class PhalconRest\Api\ApiEndpoint

Afficher le fichier Open project: olivierandriessen/phalcon-rest Class Usage Examples

Protected Properties

Свойство Type Description
$allowedRoles
$deniedRoles
$description
$exampleResponse
$handlerMethod
$httpMethod
$name
$path
$postedDataMethod

Méthodes publiques

Méthode Description
__construct ( $path, $httpMethod = HttpMethods::GET, $handlerMethod = null )
all ( ) : static Returns pre-configured all endpoint
allow ( ) : static Allows access to this endpoint for role with the given names.
create ( ) : static Returns pre-configured create endpoint
delete ( $path, string $handlerMethod = null ) : ApiEndpoint Returns pre-configured DELETE endpoint
deny ( ) : static Denies access to this endpoint for role with the given names.
description ( string $description ) : static
exampleResponse ( string $exampleResponse )
expectsJsonData ( ) : static Sets the posted data method to JSON_BODY
expectsPostData ( ) : static Sets the posted data method to POST
factory ( string $path, string $httpMethod = HttpMethods::GET, string $handlerMethod = null ) : static Returns endpoint with default values
find ( ) : static Returns pre-configured find endpoint
get ( $path, string $handlerMethod = null ) : ApiEndpoint Returns pre-configured GET endpoint
getAllowedRoles ( ) : string[]
getDeniedRoles ( ) : string[]
getDescription ( ) : string
getExampleResponse ( ) : string
getHandlerMethod ( ) : string
getHttpMethod ( ) : string
getIdentifier ( ) : string
getName ( ) : string | null
getPath ( ) : string
getPostedDataMethod ( ) : string
handlerMethod ( string $handlerMethod ) : static
head ( $path, string $handlerMethod = null ) : ApiEndpoint Returns pre-configured HEAD endpoint
name ( string $name ) : static
options ( $path, string $handlerMethod = null ) : ApiEndpoint Returns pre-configured OPTIONS endpoint
patch ( $path, string $handlerMethod = null ) : ApiEndpoint Returns pre-configured PATCH endpoint
post ( $path, string $handlerMethod = null ) : ApiEndpoint Returns pre-configured POST endpoint
postedDataMethod ( string $method ) : static
put ( $path, string $handlerMethod = null ) : ApiEndpoint Returns pre-configured PUT endpoint
remove ( ) : static Returns pre-configured remove endpoint
update ( ) : static Returns pre-configured update endpoint

Method Details

__construct() public méthode

public __construct ( $path, $httpMethod = HttpMethods::GET, $handlerMethod = null )

all() public static méthode

Returns pre-configured all endpoint
public static all ( ) : static
Résultat static

allow() public méthode

Allows access to this endpoint for role with the given names.
public allow ( ) : static
Résultat static

create() public static méthode

Returns pre-configured create endpoint
public static create ( ) : static
Résultat static

delete() public static méthode

Returns pre-configured DELETE endpoint
public static delete ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Résultat ApiEndpoint

deny() public méthode

Denies access to this endpoint for role with the given names.
public deny ( ) : static
Résultat static

description() public méthode

public description ( string $description ) : static
$description string Description for the endpoint
Résultat static

exampleResponse() public méthode

public exampleResponse ( string $exampleResponse )
$exampleResponse string Example of the response of the endpoint

expectsJsonData() public méthode

Sets the posted data method to JSON_BODY
public expectsJsonData ( ) : static
Résultat static

expectsPostData() public méthode

Sets the posted data method to POST
public expectsPostData ( ) : static
Résultat static

factory() public static méthode

Returns endpoint with default values
public static factory ( string $path, string $httpMethod = HttpMethods::GET, string $handlerMethod = null ) : static
$path string
$httpMethod string
$handlerMethod string
Résultat static

find() public static méthode

Returns pre-configured find endpoint
public static find ( ) : static
Résultat static

get() public static méthode

Returns pre-configured GET endpoint
public static get ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Résultat ApiEndpoint

getAllowedRoles() public méthode

public getAllowedRoles ( ) : string[]
Résultat string[] Array of allowed role-names

getDeniedRoles() public méthode

public getDeniedRoles ( ) : string[]
Résultat string[] Array of denied role-names

getDescription() public méthode

public getDescription ( ) : string
Résultat string Description for the endpoint

getExampleResponse() public méthode

public getExampleResponse ( ) : string
Résultat string Example of the response of the endpoint

getHandlerMethod() public méthode

public getHandlerMethod ( ) : string
Résultat string Name of controller-method to be called for the endpoint

getHttpMethod() public méthode

public getHttpMethod ( ) : string
Résultat string HTTP method of the endpoint

getIdentifier() public méthode

public getIdentifier ( ) : string
Résultat string Unique identifier for this endpoint (returns a combination of the HTTP method and the path)

getName() public méthode

public getName ( ) : string | null
Résultat string | null Name of the endpoint

getPath() public méthode

public getPath ( ) : string
Résultat string Path of the endpoint, relative to the collection

getPostedDataMethod() public méthode

public getPostedDataMethod ( ) : string
Résultat string $method One of the method constants defined in PostedDataMethods

handlerMethod() public méthode

public handlerMethod ( string $handlerMethod ) : static
$handlerMethod string Name of controller-method to be called for the endpoint
Résultat static

head() public static méthode

Returns pre-configured HEAD endpoint
public static head ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Résultat ApiEndpoint

name() public méthode

public name ( string $name ) : static
$name string Name for the endpoint
Résultat static

options() public static méthode

Returns pre-configured OPTIONS endpoint
public static options ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Résultat ApiEndpoint

patch() public static méthode

Returns pre-configured PATCH endpoint
public static patch ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Résultat ApiEndpoint

post() public static méthode

Returns pre-configured POST endpoint
public static post ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Résultat ApiEndpoint

postedDataMethod() public méthode

public postedDataMethod ( string $method ) : static
$method string One of the method constants defined in PostedDataMethods
Résultat static

put() public static méthode

Returns pre-configured PUT endpoint
public static put ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Résultat ApiEndpoint

remove() public static méthode

Returns pre-configured remove endpoint
public static remove ( ) : static
Résultat static

update() public static méthode

Returns pre-configured update endpoint
public static update ( ) : static
Résultat static

Property Details

$allowedRoles protected_oe property

protected $allowedRoles

$deniedRoles protected_oe property

protected $deniedRoles

$description protected_oe property

protected $description

$exampleResponse protected_oe property

protected $exampleResponse

$handlerMethod protected_oe property

protected $handlerMethod

$httpMethod protected_oe property

protected $httpMethod

$name protected_oe property

protected $name

$path protected_oe property

protected $path

$postedDataMethod protected_oe property

protected $postedDataMethod