Model a collection for use with HAL payloads

 Methods

__construct()

__construct(array | \Traversable | \Zend\Paginator\Paginator $collection, string $resourceRoute, $resourceRouteParams, $resourceRouteOptions) 

Parameters

$collection

array\Traversable\Zend\Paginator\Paginator

$resourceRoute

string

$resourceRouteParams

$resourceRouteOptions

Exceptions

\PhlyRestfully\Exception\InvalidCollectionException

Proxy to properties to allow read access

__get(string $name) : mixed

Parameters

$name

string

Returns

mixed

Set additional attributes to render as part of resource

setAttributes(array $attributes) : \PhlyRestfully\HalCollection

Parameters

$attributes

array

Returns

Set the collection name (for use within the _embedded object)

setCollectionName(string $name) : \PhlyRestfully\HalCollection

Parameters

$name

string

Returns

Set the collection route; used for generating pagination links

setCollectionRoute(string $route) : \PhlyRestfully\HalCollection

Parameters

$route

string

Returns

Set options to use with the collection route; used for generating pagination links

setCollectionRouteOptions(array | \Traversable $options) : \PhlyRestfully\HalCollection

Parameters

$options

array\Traversable

Exceptions

\PhlyRestfully\Exception\InvalidArgumentException

Returns

Set parameters/substitutions to use with the collection route; used for generating pagination links

setCollectionRouteParams(array | \Traversable $params) : \PhlyRestfully\HalCollection

Parameters

$params

array\Traversable

Exceptions

\PhlyRestfully\Exception\InvalidArgumentException

Returns

Set the resource key that represents the identifier name

setIdentifierName(string $name) : \PhlyRestfully\HalCollection
fluent This method is part of a fluent interface and will return the same instance

Parameters

$name

string

Returns

Set current page

setPage(int $page) : \PhlyRestfully\HalCollection

Parameters

$page

int

Exceptions

\PhlyRestfully\Exception\InvalidArgumentException for non-positive and/or non-integer values

Returns

Set page size

setPageSize(int $size) : \PhlyRestfully\HalCollection

Parameters

$size

int

Exceptions

\PhlyRestfully\Exception\InvalidArgumentException for non-positive and/or non-integer values

Returns

Set the resource route

setResourceRoute(string $route) : \PhlyRestfully\HalCollection

Parameters

$route

string

Returns

Set options to use with the resource route

setResourceRouteOptions(array | \Traversable $options) : \PhlyRestfully\HalCollection

Parameters

$options

array\Traversable

Exceptions

\PhlyRestfully\Exception\InvalidArgumentException

Returns

Set parameters/substitutions to use with the resource route

setResourceRouteParams(array | \Traversable $params) : \PhlyRestfully\HalCollection

Parameters

$params

array\Traversable

Exceptions

\PhlyRestfully\Exception\InvalidArgumentException

Returns