PHP Class PhalconRest\Api\ApiResource

Inheritance: extends ApiCollection, implements PhalconApi\Acl\MountableInterface, implements Phalcon\Mvc\Micro\CollectionInterface
Show file Open project: olivierandriessen/phalcon-rest Class Usage Examples

Protected Properties

Property Type Description
$_modelPrimaryKey
$collectionKey
$itemKey
$model
$transformer

Public Methods

Method Description
collectionKey ( string $collectionKey ) : static
crud ( string $prefix, string $name = null ) : static Returns resource with default values & all, find, create, update and delete endpoints pre-configured
factory ( string $prefix, string $name = null ) : static Returns resource with default values
getCollectionKey ( ) : string
getItemKey ( ) : string
getModel ( ) : string | null
getModelPrimaryKey ( ) : string | null
getMultipleKey ( ) : string
getSingleKey ( ) : string
getTransformer ( ) : string | null
itemKey ( string $itemKey ) : static
model ( string $model ) : static
multipleKey ( string $multipleKey ) : static
singleKey ( string $singleKey ) : static
transformer ( string $transformer ) : static

Method Details

collectionKey() public method

public collectionKey ( string $collectionKey ) : static
$collectionKey string Response key for multiple items
return static

crud() public static method

Returns resource with default values & all, find, create, update and delete endpoints pre-configured
public static crud ( string $prefix, string $name = null ) : static
$prefix string Prefix for the resource (e.g. /user)
$name string Name for the resource (e.g. users) (optional)
return static

factory() public static method

Returns resource with default values
public static factory ( string $prefix, string $name = null ) : static
$prefix string Prefix for the resource (e.g. /user)
$name string Name for the resource (e.g. users) (optional)
return static

getCollectionKey() public method

public getCollectionKey ( ) : string
return string Response key for multiple items

getItemKey() public method

public getItemKey ( ) : string
return string Response key for single item

getModel() public method

public getModel ( ) : string | null
return string | null Classname of the model

getModelPrimaryKey() public method

public getModelPrimaryKey ( ) : string | null
return string | null Primary key of the model

getMultipleKey() public method

Deprecation: Use getCollectionKey() instead
public getMultipleKey ( ) : string
return string Response key for multiple items

getSingleKey() public method

Deprecation: Use getItemKey() instead
public getSingleKey ( ) : string
return string Response key for single item

getTransformer() public method

public getTransformer ( ) : string | null
return string | null Classname of the transformer

itemKey() public method

public itemKey ( string $itemKey ) : static
$itemKey string Response key for single item
return static

model() public method

public model ( string $model ) : static
$model string Classname of the model
return static

multipleKey() public method

Deprecation: Use collectionKey() instead
public multipleKey ( string $multipleKey ) : static
$multipleKey string Response key for multiple items
return static

singleKey() public method

Deprecation: Use itemKey() instead
public singleKey ( string $singleKey ) : static
$singleKey string Response key for single item
return static

transformer() public method

public transformer ( string $transformer ) : static
$transformer string Classname of the transformer
return static

Property Details

$_modelPrimaryKey protected property

protected $_modelPrimaryKey

$collectionKey protected property

protected $collectionKey

$itemKey protected property

protected $itemKey

$model protected property

protected $model

$transformer protected property

protected $transformer