[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Document/ -> JsonapiDocument.php (summary)

Joomla! Content Management System

Copyright: (C) 2019 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 200 lines (4 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 1 class

JsonapiDocument:: (10 methods):
  __construct()
  setData()
  setErrors()
  setJsonapi()
  toArray()
  __toString()
  render()
  jsonSerialize()
  addLink()
  addMeta()


Class: JsonapiDocument  - X-Ref

JsonapiDocument class, provides an easy interface to parse output in JSON-API format.

__construct($options = array()   X-Ref
Class constructor.

param: array  $options  Associative array of options

setData(ElementInterface $element)   X-Ref
Set the data object.

param: ElementInterface  $element  Element interface.
return: $this

setErrors($errors)   X-Ref
Set the errors array.

param: array  $errors  Error array.
return: $this

setJsonapi($jsonapi)   X-Ref
Set the JSON-API array.

param: array  $jsonapi  JSON-API array.
return: $this

toArray()   X-Ref
Map everything to arrays.

return: array

__toString()   X-Ref
Map to string.

return: string

render($cache = false, $params = array()   X-Ref
Outputs the document.

param: boolean  $cache   If true, cache the output.
param: array    $params  Associative array of attributes.
return: string  The rendered data.

jsonSerialize()   X-Ref
Serialize for JSON usage.

return: array

addLink($key, $value)   X-Ref
Add a link to the output.

param: string  $key    The name of the link
param: string  $value  The link
return: $this

addMeta($key, $value)   X-Ref
Add a link to the output.

param: string  $key    The name of the metadata key
param: string  $value  The value
return: $this



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer