PHP Класс PhalconRest\Api\ApiCollection

Наследование: extends Phalcon\Mvc\Micro\Collection, implements PhalconApi\Acl\MountableInterface, implements Phalcon\Mvc\Micro\CollectionInterface
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$allowedRoles
$deniedRoles
$description
$endpointsByName
$name
$postedDataMethod

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

Метод Описание
__construct ( $prefix )
allow ( ) : static Allows access to this collection for role with the given names. This can be overwritten on the Endpoint level.
deny ( ) * Denies access to this collection for role with the given names. This can be overwritten on the Endpoint level.
description ( string $description ) : static
endpoint ( ApiEndpoint $endpoint ) : static Mounts endpoint to the collection
expectsJsonData ( ) : static Sets the posted data method to JSON_BODY
expectsPostData ( ) : static Sets the posted data method to POST
factory ( string $prefix, string $name = null ) : static Returns collection with default values
getAclResources ( )
getAclRules ( array $roles )
getAllowedRoles ( ) : string[]
getDeniedRoles ( ) : string[]
getDescription ( ) : string
getEndpoint ( string $name ) : ApiEndpoint | null
getEndpoints ( ) : ApiEndpoint[]
getIdentifier ( ) : string
getName ( ) : string | null
getPostedDataMethod ( ) : string
handler ( $handler, $lazy = true )
mount ( ApiEndpoint $endpoint ) : static Mounts endpoint to the collection
name ( string $name ) : static
postedDataMethod ( string $method ) : static
setPrefix ( $prefix )

Защищенные методы

Метод Описание
createRouteName ( ApiEndpoint $endpoint )
initialize ( ) Use this method when you extend this class in order to define the collection

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

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

public __construct ( $prefix )

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

Allows access to this collection for role with the given names. This can be overwritten on the Endpoint level.
public allow ( ) : static
Результат static

createRouteName() защищенный Метод

protected createRouteName ( ApiEndpoint $endpoint )
$endpoint ApiEndpoint

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

* Denies access to this collection for role with the given names. This can be overwritten on the Endpoint level.
public deny ( )

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

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

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

Mounts endpoint to the collection
public endpoint ( ApiEndpoint $endpoint ) : static
$endpoint ApiEndpoint Endpoint to mount
Результат static

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 collection with default values
public static factory ( string $prefix, string $name = null ) : static
$prefix string Prefix for the collection (e.g. /auth)
$name string Name for the collection (e.g. authentication) (optional)
Результат static

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

public getAclResources ( )

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

public getAclRules ( array $roles )
$roles array

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 of the collection

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

public getEndpoint ( string $name ) : ApiEndpoint | null
$name string Name for the endpoint to return
Результат ApiEndpoint | null Endpoint with the given name

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

public getEndpoints ( ) : ApiEndpoint[]
Результат ApiEndpoint[] Array of all mounted endpoints

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

public getIdentifier ( ) : string
Результат string Unique identifier for this collection (returns the prefix)

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

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

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

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

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

public handler ( $handler, $lazy = true )

initialize() защищенный Метод

Use this method when you extend this class in order to define the collection
protected initialize ( )

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

Mounts endpoint to the collection
public mount ( ApiEndpoint $endpoint ) : static
$endpoint ApiEndpoint Endpoint to mount (shortcut for endpoint function)
Результат static

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

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

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

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

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

public setPrefix ( $prefix )

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

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

protected $allowedRoles

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

protected $deniedRoles

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

protected $description

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

protected $endpointsByName

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

protected $name

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

protected $postedDataMethod