abstract class JsonApiSerializerAbstract implements JsonApiSerializationInterface

Properties

protected string $type The type.

Methods

mixed
getDeserializationClass()

No description

string
getType(mixed $model = null)

Get the type.

string
getId(mixed $model)

Get the id.

array
getAttributes(mixed $model, array $fields = null)

Get the attributes array.

array
getLinks(mixed $model)

Get the links array.

array
getMeta(mixed $model)

Get the meta.

mixed
setType(string $type)

No description

getRelationship(mixed $model, string $name)

Get a relationship.

string
getRelationshipMethodName(string $name)

Get the serializer method name for the given relationship.

$this
setDocumentType($type)

No description

Details

at line 11
abstract mixed getDeserializationClass()

Return Value

mixed

at line 22
string getType(mixed $model = null)

Get the type.

Parameters

mixed $model

Return Value

string

at line 29
string getId(mixed $model)

Get the id.

Parameters

mixed $model

Return Value

string

at line 36
array getAttributes(mixed $model, array $fields = null)

Get the attributes array.

Parameters

mixed $model
array $fields

Return Value

array

Get the links array.

Parameters

mixed $model

Return Value

array

at line 51
array getMeta(mixed $model)

Get the meta.

Parameters

mixed $model

Return Value

array

at line 60
mixed setType(string $type)

Parameters

string $type

Return Value

mixed

at line 72
JsonApiRelationship|null getRelationship(mixed $model, string $name)

Get a relationship.

Parameters

mixed $model
string $name

Return Value

JsonApiRelationship|null

at line 95
protected string getRelationshipMethodName(string $name)

Get the serializer method name for the given relationship.

kebab-case is converted into camelCase.

Parameters

string $name

Return Value

string

at line 107
$this setDocumentType($type)

Parameters

$type

Return Value

$this