JoomlaSerializer

Extends 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

Joomla CMS

Methods

__construct

Constructor.

__construct( type) : 
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) : mixed||string|int
since

4.0.0

Arguments

post

array<string|int, mixed>|stdClass|CMSObjectThe data container

fields

array<string|int, mixed>|nullThe requested fields to be rendered

Response

array<string|int, mixed>

getRelationship

Get a relationship.

getRelationship( model,  name) : \Tobscure\JsonApi\Relationship|null
since

4.0.0

Arguments

model

mixedThe model of the entity being rendered

name

stringThe name of the relationship to return

Response

Relationship|null