PHP Класс PhalconRest\Api\ApiEndpoint

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$allowedRoles
$deniedRoles
$description
$exampleResponse
$handlerMethod
$httpMethod
$name
$path
$postedDataMethod

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

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

all() публичный статический Метод

Returns pre-configured all endpoint
public static all ( ) : static
Результат static

allow() публичный Метод

Allows access to this endpoint for role with the given names.
public allow ( ) : static
Результат static

create() публичный статический Метод

Returns pre-configured create endpoint
public static create ( ) : static
Результат static

delete() публичный статический Метод

Returns pre-configured DELETE endpoint
public static delete ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Результат ApiEndpoint

deny() публичный Метод

Denies access to this endpoint for role with the given names.
public deny ( ) : static
Результат static

description() публичный Метод

public description ( string $description ) : static
$description string Description for the endpoint
Результат static

exampleResponse() публичный Метод

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

expectsJsonData() публичный Метод

Sets the posted data method to JSON_BODY
public expectsJsonData ( ) : static
Результат static

expectsPostData() публичный Метод

Sets the posted data method to POST
public expectsPostData ( ) : static
Результат static

factory() публичный статический Метод

Returns endpoint with default values
public static factory ( string $path, string $httpMethod = HttpMethods::GET, string $handlerMethod = null ) : static
$path string
$httpMethod string
$handlerMethod string
Результат static

find() публичный статический Метод

Returns pre-configured find endpoint
public static find ( ) : static
Результат static

get() публичный статический Метод

Returns pre-configured GET endpoint
public static get ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Результат ApiEndpoint

getAllowedRoles() публичный Метод

public getAllowedRoles ( ) : string[]
Результат string[] Array of allowed role-names

getDeniedRoles() публичный Метод

public getDeniedRoles ( ) : string[]
Результат string[] Array of denied role-names

getDescription() публичный Метод

public getDescription ( ) : string
Результат string Description for the endpoint

getExampleResponse() публичный Метод

public getExampleResponse ( ) : string
Результат string Example of the response of the endpoint

getHandlerMethod() публичный Метод

public getHandlerMethod ( ) : string
Результат string Name of controller-method to be called for the endpoint

getHttpMethod() публичный Метод

public getHttpMethod ( ) : string
Результат string HTTP method of the endpoint

getIdentifier() публичный Метод

public getIdentifier ( ) : string
Результат string Unique identifier for this endpoint (returns a combination of the HTTP method and the path)

getName() публичный Метод

public getName ( ) : string | null
Результат string | null Name of the endpoint

getPath() публичный Метод

public getPath ( ) : string
Результат string Path of the endpoint, relative to the collection

getPostedDataMethod() публичный Метод

public getPostedDataMethod ( ) : string
Результат string $method One of the method constants defined in PostedDataMethods

handlerMethod() публичный Метод

public handlerMethod ( string $handlerMethod ) : static
$handlerMethod string Name of controller-method to be called for the endpoint
Результат static

head() публичный статический Метод

Returns pre-configured HEAD endpoint
public static head ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Результат ApiEndpoint

name() публичный Метод

public name ( string $name ) : static
$name string Name for the endpoint
Результат static

options() публичный статический Метод

Returns pre-configured OPTIONS endpoint
public static options ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Результат ApiEndpoint

patch() публичный статический Метод

Returns pre-configured PATCH endpoint
public static patch ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Результат ApiEndpoint

post() публичный статический Метод

Returns pre-configured POST endpoint
public static post ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Результат ApiEndpoint

postedDataMethod() публичный Метод

public postedDataMethod ( string $method ) : static
$method string One of the method constants defined in PostedDataMethods
Результат static

put() публичный статический Метод

Returns pre-configured PUT endpoint
public static put ( $path, string $handlerMethod = null ) : ApiEndpoint
$path
$handlerMethod string
Результат ApiEndpoint

remove() публичный статический Метод

Returns pre-configured remove endpoint
public static remove ( ) : static
Результат static

update() публичный статический Метод

Returns pre-configured update endpoint
public static update ( ) : static
Результат static

Описание свойств

$allowedRoles защищенное свойство

protected $allowedRoles

$deniedRoles защищенное свойство

protected $deniedRoles

$description защищенное свойство

protected $description

$exampleResponse защищенное свойство

protected $exampleResponse

$handlerMethod защищенное свойство

protected $handlerMethod

$httpMethod защищенное свойство

protected $httpMethod

$name защищенное свойство

protected $name

$path защищенное свойство

protected $path

$postedDataMethod защищенное свойство

protected $postedDataMethod