PHP Class Tobscure\JsonApi\Document

Inheritance: implements JsonSerializabl\JsonSerializable, use trait LinksTrait, use trait MetaTrait
Afficher le fichier Open project: tobscure/json-api Class Usage Examples

Protected Properties

Свойство Type Description
$data Tobscure\JsonApi\ElementInterface The data object.
$errors array The errors array.
$included array The included array.
$jsonapi array The jsonapi array.

Méthodes publiques

Méthode Description
__construct ( Tobscure\JsonApi\ElementInterface $data = null )
__toString ( ) : string Map to string.
jsonSerialize ( ) : array Serialize for JSON usage.
setData ( Tobscure\JsonApi\ElementInterface $element ) Set the data object.
setErrors ( array $errors ) Set the errors array.
setJsonapi ( array $jsonapi ) Set the jsonapi array.
toArray ( ) : array Map everything to arrays.

Méthodes protégées

Méthode Description
getIncluded ( Tobscure\JsonApi\ElementInterface $element, boolean $includeParent = false ) : Resource[] Get included resources.
mergeResource ( array $resources, Resource $newResource ) : Resource[]

Method Details

__construct() public méthode

public __construct ( Tobscure\JsonApi\ElementInterface $data = null )
$data Tobscure\JsonApi\ElementInterface

__toString() public méthode

Map to string.
public __toString ( ) : string
Résultat string

getIncluded() protected méthode

Get included resources.
protected getIncluded ( Tobscure\JsonApi\ElementInterface $element, boolean $includeParent = false ) : Resource[]
$element Tobscure\JsonApi\ElementInterface
$includeParent boolean
Résultat Resource[]

jsonSerialize() public méthode

Serialize for JSON usage.
public jsonSerialize ( ) : array
Résultat array

mergeResource() protected méthode

protected mergeResource ( array $resources, Resource $newResource ) : Resource[]
$resources array
$newResource Resource
Résultat Resource[]

setData() public méthode

Set the data object.
public setData ( Tobscure\JsonApi\ElementInterface $element )
$element Tobscure\JsonApi\ElementInterface

setErrors() public méthode

Set the errors array.
public setErrors ( array $errors )
$errors array

setJsonapi() public méthode

Set the jsonapi array.
public setJsonapi ( array $jsonapi )
$jsonapi array

toArray() public méthode

Map everything to arrays.
public toArray ( ) : array
Résultat array

Property Details

$data protected_oe property

The data object.
protected ElementInterface,Tobscure\JsonApi $data
Résultat Tobscure\JsonApi\ElementInterface

$errors protected_oe property

The errors array.
protected array $errors
Résultat array

$included protected_oe property

The included array.
protected array $included
Résultat array

$jsonapi protected_oe property

The jsonapi array.
protected array $jsonapi
Résultat array