Add a single link to the links collection
boolean
addLink
(
string $rel,
FOFHalLink $link, [
boolean $overwrite =
true])
-
string
$rel: The relation of the link to the document. See RFC 5988 http://tools.ietf.org/html/rfc5988#section-6.2.2 A document MUST always have a "self" link.
-
FOFHalLink
$link: The actual link object
-
boolean
$overwrite: When false and a link of $rel relation exists, an array of links is created. Otherwise the existing link is overwriten with the new one
Add multiple links to the links collection
boolean
addLinks
(string $rel, array $links, [boolean $overwrite = true])
-
string
$rel: The relation of the links to the document. See RFC 5988.
-
array
$links: An array of FOFHalLink objects
-
boolean
$overwrite: When false and a link of $rel relation exists, an array of links is created. Otherwise the existing link is overwriten with the new one
Returns the collection of links
-
string
$rel: Optional; the relation to return the links for