### Methods

## Constructor

    __construct(string $class, array $options)

Sets the class, and passes any options provided to the appropriate setter methods, after first converting them to lowercase and stripping underscores.

If the class does not exist, raises an exception.

### Parameters

#### $class

`string`

#### $options

`array`

### Exceptions

`\PhlyRestfully\Exception\InvalidArgumentException` |

## Retrieve the class this metadata is associated with

    getClass() : string

### Returns

`string`

## Retrieve the hydrator to associate with this class, if any

    getHydrator() : null | \Zend\Stdlib\Hydrator\HydratorInterface

### Returns

`null``\Zend\Stdlib\Hydrator\HydratorInterface`

## Retrieve the identifier name

    getIdentifierName() : string

### Returns

`string`

## Retrieve the resource route

    getResourceRoute() : null | string

If not set, uses the route or url, depending on which is present.

### Returns

`null` `string`

## Retrieve the route to use for URL generation

    getRoute() : null | string

### Returns

`null` `string`

## Retrieve an route options to use in URL generation

    getRouteOptions() : array

### Returns

`array`

## Retrieve any route parameters to use in URL generation

    getRouteParams() : array

### Returns

`array`

## Retrieve the URL to use for this resource, if present

    getUrl() : null | string

### Returns

`null` `string`

## Is a hydrator associated with this class?

    hasHydrator() : bool

### Returns

`bool`

## Is a route present for this class?

    hasRoute() : bool

### Returns

`bool`

## Is a URL set for this class?

    hasUrl() : bool

### Returns

`bool`

## Does this class represent a collection?

    isCollection() : bool

### Returns

`bool`

## Set the hydrator to use with this class

    setHydrator(string | \Zend\Stdlib\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Metadata

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

### Parameters

#### $hydrator

`string``\Zend\Stdlib\Hydrator\HydratorInterface`

### Exceptions

`\PhlyRestfully\Exception\InvalidArgumentException` | if the class or hydrator does not implement HydratorInterface

### Returns

`\PhlyRestfully\Metadata`

## Set the identifier name

    setIdentifierName(string | mixed $identifier) : \PhlyRestfully\Metadata

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

### Parameters

#### $identifier

`string` `mixed`

### Returns

`\PhlyRestfully\Metadata`

## Set the flag indicating collection status

    setIsCollection(bool $flag) : \PhlyRestfully\Metadata

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

### Parameters

#### $flag

`bool`

### Returns

`\PhlyRestfully\Metadata`

## Set the resource route (for embedded resources in collections)

    setResourceRoute(string $route) : \PhlyRestfully\Metadata

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

### Parameters

#### $route

`string`

### Returns

`\PhlyRestfully\Metadata`

## Set the route for URL generation

    setRoute(string $route) : \PhlyRestfully\Metadata

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

### Parameters

#### $route

`string`

### Returns

`\PhlyRestfully\Metadata`

## Set route options for URL generation

    setRouteOptions(array $options) : \PhlyRestfully\Metadata

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

### Parameters

#### $options

`array`

### Returns

`\PhlyRestfully\Metadata`

## Set route parameters for URL generation

    setRouteParams(array $params) : \PhlyRestfully\Metadata

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

### Parameters

#### $params

`array`

### Returns

`\PhlyRestfully\Metadata`

## Set the URL to use with this resource

    setUrl(string $url) : \PhlyRestfully\Metadata

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

### Parameters

#### $url

`string`

### Returns

`\PhlyRestfully\Metadata`