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`

## Get link collection

    getLinks() : \PhlyRestfully\LinkCollection

### Returns

`\PhlyRestfully\LinkCollection`

## Retrieve default resource links, if any

    getResourceLinks() : null | \PhlyRestfully\LinkCollection

### Returns

`null``\PhlyRestfully\LinkCollection`

## Set additional attributes to render as part of resource

    setAttributes(array $attributes) : \PhlyRestfully\HalCollection

### Parameters

#### $attributes

`array`

### Returns

`\PhlyRestfully\HalCollection`

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

    setCollectionName(string $name) : \PhlyRestfully\HalCollection

### Parameters

#### $name

`string`

### Returns

`\PhlyRestfully\HalCollection`

## Set the collection route; used for generating pagination links

    setCollectionRoute(string $route) : \PhlyRestfully\HalCollection

### Parameters

#### $route

`string`

### Returns

`\PhlyRestfully\HalCollection`

## 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

`\PhlyRestfully\HalCollection`

## 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

`\PhlyRestfully\HalCollection`

## 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

`\PhlyRestfully\HalCollection`

## Set link collection

    setLinks(\PhlyRestfully\LinkCollection $links) : \PhlyRestfully\HalCollection

fluent | This method is part of a fluent interface and will return the same instance

### Parameters

#### $links

`\PhlyRestfully\LinkCollection`

### Returns

`\PhlyRestfully\HalCollection`

## Set current page

    setPage(int $page) : \PhlyRestfully\HalCollection

### Parameters

#### $page

`int`

### Exceptions

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

### Returns

`\PhlyRestfully\HalCollection`

## Set page size

    setPageSize(int $size) : \PhlyRestfully\HalCollection

### Parameters

#### $size

`int`

### Exceptions

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

### Returns

`\PhlyRestfully\HalCollection`

## Set default set of links to use for resources

    setResourceLinks(\PhlyRestfully\LinkCollection $links) : \PhlyRestfully\HalCollection

fluent | This method is part of a fluent interface and will return the same instance

### Parameters

#### $links

`\PhlyRestfully\LinkCollection`

### Returns

`\PhlyRestfully\HalCollection`

## Set the resource route

    setResourceRoute(string $route) : \PhlyRestfully\HalCollection

### Parameters

#### $route

`string`

### Returns

`\PhlyRestfully\HalCollection`

## Set options to use with the resource route

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

### Parameters

#### $options

`array``\Traversable`

### Exceptions

`\PhlyRestfully\Exception\InvalidArgumentException` |

### Returns

`\PhlyRestfully\HalCollection`

## Set parameters/substitutions to use with the resource route

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

### Parameters

#### $params

`array``\Traversable`

### Exceptions

`\PhlyRestfully\Exception\InvalidArgumentException` |

### Returns

`\PhlyRestfully\HalCollection`