JsonApiDocument
class JsonApiDocument implements JsonSerializable
Traits
Class JsonApiLinkTrait
Class JsonApiMetaTrait
Properties
| protected array | $links | The links array. | from JsonApiLinkTrait |
| protected array | $meta | The meta data array. | from JsonApiMetaTrait |
| protected array | $included | The included array. | |
| protected array | $errors | The errors array. | |
| protected array | $jsonApi | The jsonapi array. | |
| protected JsonApiElementInterface | $data | The data object. |
Methods
$this
$this
setErrors(array $errors)
Set the errors array.
$this
setJsonApi(array $jsonApi)
Set the jsonApi array.
array
toArray()
Map everything to arrays.
string
__toString()
Map to string.
array
jsonSerialize()
Serialize for JSON usage.
array
deserialize(null $string = null)
No description
mixed|null
array
bool
isAllowedAttribute($attributeName, $serializerAttributes)
No description
getData()
No description
Details
in JsonApiLinkTrait at line 23
array
getLinks()
Get the links.
in JsonApiLinkTrait at line 35
$this
setLinks(array $links)
Set the links.
in JsonApiLinkTrait at line 49
$this
addLink(string $key, string $value)
Add a link.
in JsonApiMetaTrait at line 23
array
getMeta()
Get the meta.
in JsonApiMetaTrait at line 35
$this
setMeta(array $meta)
Set the meta data array.
in JsonApiMetaTrait at line 49
$this
addMeta(string $key, string $value)
Add meta data.
at line 56
__construct(JsonApiElementInterface $data = null)
at line 82
protected JsonApiOne[]
getIncluded(JsonApiElementInterface $element, bool $includeParent = false)
Get included resources.
at line 127
protected JsonApiOne[]
mergeResource(array $resources, JsonApiOne $newResource)
at line 147
$this
setData(JsonApiElementInterface $element)
Set the data object.
at line 159
$this
setErrors(array $errors)
Set the errors array.
at line 171
$this
setJsonApi(array $jsonApi)
Set the jsonApi array.
at line 181
array
toArray()
Map everything to arrays.
at line 213
string
__toString()
Map to string.
at line 222
array
jsonSerialize()
Serialize for JSON usage.