Interface describing operations for a given resource.

 Methods

Create a record in the resource

create(array | object $data) : array | object

Parameters

$data

arrayobject

Returns

arrayobject

Delete an existing record

delete(string | int $id) : bool

Parameters

$id

stringint

Returns

bool

Delete an existing collection of records

deleteList(null | array $data) : bool

Parameters

$data

nullarray

Returns

bool

Fetch an existing record

fetch(string | int $id) : false | array | object

Parameters

$id

stringint

Returns

falsearrayobject

Fetch a collection of records

fetchAll() : \Zend\Paginator\Paginator

Returns

\Zend\Paginator\Paginator

getEventParam()

getEventParam(mixed $name, mixed $default) : mixed

Parameters

$name

mixed

$default

mixed

Returns

mixed

Get the event parameters

getEventParams() : array

Returns

array

Partial update of an existing record

patch(string | int $id, array | object $data) : array | object

Parameters

$id

stringint

$data

arrayobject

Returns

arrayobject

Update (replace) an existing collection of records

replaceList(array $data) : array | object

Parameters

$data

array

Returns

arrayobject

setEventParam()

setEventParam(string $name, mixed $value) : mixed

Parameters

$name

string

$value

mixed

Returns

mixed

Set the event parameters

setEventParams(array $params) : \PhlyRestfully\ResourceInterface
fluent This method is part of a fluent interface and will return the same instance

Parameters

$params

array

Returns

Update (replace) an existing record

update(string | int $id, array | object $data) : array | object

Parameters

$id

stringint

$data

arrayobject

Returns

arrayobject