◆ __construct()
__construct |
( |
|
$data = null | ) |
|
Public constructor
- Paramètres
-
mixed | $data | The data of the document (usually, the resource state) |
Références $data.
◆ addData()
addData |
( |
|
$data, |
|
|
|
$overwrite = true |
|
) |
| |
Add data to the document
- Paramètres
-
stdClass | $data | The data to add |
boolean | $overwrite | Should I overwrite existing data? |
- Renvoie
- void
Références $data.
◆ addEmbedded()
Add an embedded document
- Paramètres
-
string | $rel | The relation of the embedded document to its container document |
FOFHalDocument | $document | The document to add |
boolean | $overwrite | Should I overwrite existing data with the same relation? |
- Renvoie
- boolean
Références $document, $rel, et elseif.
◆ addLink()
Add a link to the document
- Paramètres
-
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 |
- Voir également
- FOFHalLinks::addLink
- Renvoie
- boolean True if the link was added to the collection
Références $link, et $rel.
◆ addLinks()
addLinks |
( |
|
$rel, |
|
|
array |
$links, |
|
|
|
$overwrite = true |
|
) |
| |
Add links to the document
- Paramètres
-
string | $rel | The relation of the link 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 |
- Voir également
- FOFHalLinks::addLinks
- Renvoie
- boolean
Références $rel.
◆ getData()
Return the data attached to this document
- Renvoie
- array|stdClass
◆ getEmbedded()
getEmbedded |
( |
|
$rel = null | ) |
|
Returns the collection of embedded documents
- Paramètres
-
string | $rel | Optional; the relation to return the embedded documents for |
- Renvoie
- array|FOFHalDocument
Références $rel, et elseif.
◆ getLinks()
Returns the collection of links of this document
- Paramètres
-
string | $rel | The relation of the links to fetch. Skip to get all links. |
- Renvoie
- array
Références $rel.
◆ render()
render |
( |
|
$format = 'json' | ) |
|
Instantiate and call a suitable renderer class to render this document into the specified format.
- Paramètres
-
string | $format | The format to render the document into, e.g. 'json' |
- Renvoie
- string The rendered document
- Exceptions
-
RuntimeException | If the format is unknown, i.e. there is no suitable renderer |
Références $format, et $renderer.
◆ $_data
◆ $_dataKey
◆ $_embedded
◆ $_links
La documentation de cette classe a été générée à partir du fichier suivant :