class JsonApiMany implements JsonApiElementInterface

Properties

protected array $resources
protected JsonApiSerializationInterface $serializer
protected $relationsPath

Methods

__construct(mixed $data, mixed $serializer)

Create a new collection instance.

getSerializer()

No description

setSerializer(JsonApiSerializationInterface $serializer)

No description

array
getResources()

Get the resources array.

void
setResources(array $resources)

Set the resources array.

array
toArray()

Map to a "resource object" array.

array
toIdentifier()

Map to a "resource object identifier" array.

$this
relations(string|array $relationships)

Request a relationship to be included.

$this
attributes($attributes)

Request a restricted set of fields.

buildResources(mixed $data, JsonApiSerializationInterface $serializer)

Convert an array of raw data to Resource objects.

mixed
getDenormalizedData($relationShips, $included, $name)

No description

Details

at line 26
__construct(mixed $data, mixed $serializer)

Create a new collection instance.

Parameters

mixed $data
mixed $serializer

at line 35
getSerializer()

at line 43
setSerializer(JsonApiSerializationInterface $serializer)

Parameters

JsonApiSerializationInterface $serializer

at line 51
array getResources()

Get the resources array.

Return Value

array

at line 63
void setResources(array $resources)

Set the resources array.

Parameters

array $resources

Return Value

void

at line 71
array toArray()

Map to a "resource object" array.

Return Value

array

at line 81
array toIdentifier()

Map to a "resource object identifier" array.

Return Value

array

at line 92
$this relations(string|array $relationships)

Request a relationship to be included.

Parameters

string|array $relationships

Return Value

$this

at line 103
$this attributes($attributes)

Request a restricted set of fields.

Parameters

$attributes

Return Value

$this

at line 119
protected JsonApiOne[] buildResources(mixed $data, JsonApiSerializationInterface $serializer)

Convert an array of raw data to Resource objects.

Parameters

mixed $data
JsonApiSerializationInterface $serializer

Return Value

JsonApiOne[]

at line 144
mixed getDenormalizedData($relationShips, $included, $name)

Parameters

$relationShips
$included
$name

Return Value

mixed