PHP Class PhalconRest\Api\ApiCollection

Inheritance: extends Phalcon\Mvc\Micro\Collection, implements PhalconApi\Acl\MountableInterface, implements Phalcon\Mvc\Micro\CollectionInterface
Afficher le fichier Open project: olivierandriessen/phalcon-rest Class Usage Examples

Protected Properties

Свойство Type Description
$allowedRoles
$deniedRoles
$description
$endpointsByName
$name
$postedDataMethod

Méthodes publiques

Méthode Description
__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 )

Méthodes protégées

Méthode Description
createRouteName ( ApiEndpoint $endpoint )
initialize ( ) Use this method when you extend this class in order to define the collection

Method Details

__construct() public méthode

public __construct ( $prefix )

allow() public méthode

Allows access to this collection for role with the given names. This can be overwritten on the Endpoint level.
public allow ( ) : static
Résultat static

createRouteName() protected méthode

protected createRouteName ( ApiEndpoint $endpoint )
$endpoint ApiEndpoint

deny() public méthode

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

description() public méthode

public description ( string $description ) : static
$description string Description of the collection
Résultat static

endpoint() public méthode

Mounts endpoint to the collection
public endpoint ( ApiEndpoint $endpoint ) : static
$endpoint ApiEndpoint Endpoint to mount
Résultat static

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 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)
Résultat static

getAclResources() public méthode

public getAclResources ( )

getAclRules() public méthode

public getAclRules ( array $roles )
$roles array

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

getEndpoint() public méthode

public getEndpoint ( string $name ) : ApiEndpoint | null
$name string Name for the endpoint to return
Résultat ApiEndpoint | null Endpoint with the given name

getEndpoints() public méthode

public getEndpoints ( ) : ApiEndpoint[]
Résultat ApiEndpoint[] Array of all mounted endpoints

getIdentifier() public méthode

public getIdentifier ( ) : string
Résultat string Unique identifier for this collection (returns the prefix)

getName() public méthode

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

getPostedDataMethod() public méthode

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

handler() public méthode

public handler ( $handler, $lazy = true )

initialize() protected méthode

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

mount() public méthode

Mounts endpoint to the collection
public mount ( ApiEndpoint $endpoint ) : static
$endpoint ApiEndpoint Endpoint to mount (shortcut for endpoint function)
Résultat static

name() public méthode

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

postedDataMethod() public méthode

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

setPrefix() public méthode

public setPrefix ( $prefix )

Property Details

$allowedRoles protected_oe property

protected $allowedRoles

$deniedRoles protected_oe property

protected $deniedRoles

$description protected_oe property

protected $description

$endpointsByName protected_oe property

protected $endpointsByName

$name protected_oe property

protected $name

$postedDataMethod protected_oe property

protected $postedDataMethod