Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe FOFHalDocument

Fonctions membres publiques

 __construct ($data=null)
 
 addLink ($rel, FOFHalLink $link, $overwrite=true)
 
 addLinks ($rel, array $links, $overwrite=true)
 
 addData ($data, $overwrite=true)
 
 addEmbedded ($rel, FOFHalDocument $document, $overwrite=true)
 
 getLinks ($rel=null)
 
 getEmbedded ($rel=null)
 
 getData ()
 
 render ($format='json')
 

Attributs privés

 $_links = null
 
 $_data = null
 
 $_embedded = array()
 
 $_dataKey = '_list'
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $data = null)

Public constructor

Paramètres
mixed$dataThe data of the document (usually, the resource state)

Références $data.

Documentation des fonctions membres

◆ addData()

addData (   $data,
  $overwrite = true 
)

Add data to the document

Paramètres
stdClass$dataThe data to add
boolean$overwriteShould I overwrite existing data?
Renvoie
void

Références $data.

◆ addEmbedded()

addEmbedded (   $rel,
FOFHalDocument  $document,
  $overwrite = true 
)

Add an embedded document

Paramètres
string$relThe relation of the embedded document to its container document
FOFHalDocument$documentThe document to add
boolean$overwriteShould I overwrite existing data with the same relation?
Renvoie
boolean

Références $document, $rel, et elseif.

◆ addLink()

addLink (   $rel,
FOFHalLink  $link,
  $overwrite = true 
)

Add a link to the document

Paramètres
string$relThe 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$linkThe actual link object
boolean$overwriteWhen 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$relThe relation of the link to the document. See RFC 5988
array$linksAn array of FOFHalLink objects
boolean$overwriteWhen 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()

getData ( )

Return the data attached to this document

Renvoie
array|stdClass

◆ getEmbedded()

getEmbedded (   $rel = null)

Returns the collection of embedded documents

Paramètres
string$relOptional; the relation to return the embedded documents for
Renvoie
array|FOFHalDocument

Références $rel, et elseif.

◆ getLinks()

getLinks (   $rel = null)

Returns the collection of links of this document

Paramètres
string$relThe 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$formatThe format to render the document into, e.g. 'json'
Renvoie
string The rendered document
Exceptions
RuntimeExceptionIf the format is unknown, i.e. there is no suitable renderer

Références $format, et $renderer.

Documentation des champs

◆ $_data

$_data = null
private

◆ $_dataKey

$_dataKey = '_list'
private

◆ $_embedded

$_embedded = array()
private

◆ $_links

$_links = null
private

La documentation de cette classe a été générée à partir du fichier suivant :