JoomlaSerializer

Extends \Tobscure\JsonApi\AbstractSerializer

This class does the messy job of sanitising all the classes Joomla has that contain data and converting them into a standard array that can be consumed by the Tobscure library. It also throws appropriate plugin events to allow 3rd party extensions to add custom data and relations into these properties before they are rendered

since

4.0.0

package

Application

Methods

__construct

Constructor.

__construct(string type) : mixed
since

4.0.0

Arguments

type

stringThe content type to be loaded

Response

mixed

getAttributes

Get the attributes array.

getAttributes(array|\stdClass|\Joomla\CMS\Object\CMSObject post, array|null fields = null) : array
since

4.0.0

Arguments

post

array|\stdClass|\Joomla\CMS\Object\CMSObjectThe data container

fields

array|nullThe requested fields to be rendered

Response

array

getRelationship

Get a relationship.

getRelationship(mixed model, string name) : \Tobscure\JsonApi\Relationship|void
since

4.0.0

Arguments

model

mixedThe model of the entity being rendered

name

stringThe name of the relationship to return

Response

\Tobscure\JsonApi\Relationship|void