Methods
Create a link relation
__construct(string $relation)
todo |
filtering and/or validation of relation string |
Parameters
$relation
string
Retrieve the link relation
getRelation() : string
Return the route to be used to generate the link URL, if any
getRoute() : null | string
Retrieve route assembly options, if any
getRouteOptions() : array
Retrieve route assembly parameters/substitutions, if any
getRouteParams() : array
Retrieve the link URL, if set
getUrl() : null | string
Does the link have a route set?
hasRoute() : bool
Does the link have a URL set?
hasUrl() : bool
Is the link relation complete -- do we have either a URL or a route set?
isComplete() : bool
Set the route to use when generating the relation URI
setRoute(string $route, null | array | \Traversable $params, null | array | \Traversable $options) : \PhlyRestfully\Link
If any params or options are passed, those will be passed to route assembly.
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$route
string
$params
null
array
\Traversable
$options
null
array
\Traversable
Returns
Set route assembly options
setRouteOptions(array | \Traversable $options) : \PhlyRestfully\Link
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$options
array
\Traversable
Returns
Set route assembly parameters/substitutions
setRouteParams(array | \Traversable $params) : \PhlyRestfully\Link
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$params
array
\Traversable
Returns
Set an explicit URL for the link relation
setUrl(string $url) : \PhlyRestfully\Link
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$url
string
Returns