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
Retrieve the class this metadata is associated with
getClass() : string
Retrieve the hydrator to associate with this class, if any
getHydrator() : null | \Zend\Hydrator\HydratorInterface
Returns
null
\Zend\Hydrator\HydratorInterface
Retrieve the identifier name
getIdentifierName() : 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
Retrieve an route options to use in URL generation
getRouteOptions() : array
Retrieve any route parameters to use in URL generation
getRouteParams() : array
Retrieve the URL to use for this resource, if present
getUrl() : null | string
Is a hydrator associated with this class?
hasHydrator() : bool
Is a route present for this class?
hasRoute() : bool
Is a URL set for this class?
hasUrl() : bool
Does this class represent a collection?
isCollection() : bool
Set the hydrator to use with this class
setHydrator(string | \Zend\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Metadata
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$hydrator
string
\Zend\Hydrator\HydratorInterface
Exceptions
Returns
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
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
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
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
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
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
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