PHP Класс ZF\Apigility\DbConnectedResource

Наследование: extends ZF\Rest\AbstractResourceListener
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$collectionClass Name of collection class
$identifierName Name of identifier field
$table Zend\Db\TableGateway\TableGatewayInterface

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

Метод Описание
__construct ( Zend\Db\TableGateway\TableGatewayInterface $table, string $identifierName, string $collectionClass )
create ( array | object $data ) : array | object Create a new resource.
delete ( integer | string $id ) : boolean Delete an existing resource.
fetch ( integer | string $id ) : array | object Fetch an existing resource.
fetchAll ( array | object $data = [] ) : Zend\Paginator\Paginator Fetch a paginated set of resources.
patch ( integer | string $id, array | object $data ) : array | object Update an existing resource.
update ( integer | string $id, array | object $data ) : array | object Replace an existing resource.

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

Метод Описание
retrieveData ( mixed $data ) : array Retrieve data

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

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

public __construct ( Zend\Db\TableGateway\TableGatewayInterface $table, string $identifierName, string $collectionClass )
$table Zend\Db\TableGateway\TableGatewayInterface
$identifierName string
$collectionClass string

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

Create a new resource.
public create ( array | object $data ) : array | object
$data array | object Data representing the resource to create.
Результат array | object Newly created resource.

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

Delete an existing resource.
public delete ( integer | string $id ) : boolean
$id integer | string Identifier of resource.
Результат boolean

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

Fetch an existing resource.
public fetch ( integer | string $id ) : array | object
$id integer | string Identifier of resource.
Результат array | object Resource.

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

Fetch a paginated set of resources.
public fetchAll ( array | object $data = [] ) : Zend\Paginator\Paginator
$data array | object Ignored.
Результат Zend\Paginator\Paginator

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

Update an existing resource.
public patch ( integer | string $id, array | object $data ) : array | object
$id integer | string Identifier of resource.
$data array | object Data with which to update the resource.
Результат array | object Updated resource.

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

Retrieve data from composed input filter, if any; if none, cast the data passed to the method to an array.
protected retrieveData ( mixed $data ) : array
$data mixed
Результат array

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

Replace an existing resource.
public update ( integer | string $id, array | object $data ) : array | object
$id integer | string Identifier of resource.
$data array | object Data with which to replace the resource.
Результат array | object Updated resource.

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

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

Name of collection class
protected $collectionClass

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

Name of identifier field
protected $identifierName

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

protected TableGatewayInterface,Zend\Db\TableGateway $table
Результат Zend\Db\TableGateway\TableGatewayInterface