class ResourceArray implements ResourceInterface, Countable, ArrayAccess, IteratorAggregate

A ResourceArray holds the response of an API request if more than one resource has been requested.

In addition to the retrieved items themselves it also provides some access to metadata.

Methods

__construct(array $items, int $total, int $limit, int $skip)

ResourceArray constructor.

int
getTotal()

Returns the total amount of resources matching the filter.

int
getLimit()

The limit used when retrieving this ResourceArray.

int
getSkip()

The number of skipped resources when retrieving this ResourceArray.

getItems()

Get the returned values as a PHP array.

getSystemProperties()

Returns the resource's system properties, defined in the object "sys" in Contentful's responses.

asLink()

Creates a Link representation of the current resource.

string
getId()

Shortcut for retrieving the resource ID from the system properties object.

string
getType()

Shortcut for retrieving the resource type from the system properties object.

jsonSerialize()

{@inheritdoc}

count()

{@inheritdoc}

getIterator()

{@inheritdoc}

offsetExists($offset)

{@inheritdoc}

offsetGet($offset)

{@inheritdoc}

offsetSet($offset, $value)

{@inheritdoc}

offsetUnset($offset)

{@inheritdoc}

Details

at line 53
__construct(array $items, int $total, int $limit, int $skip)

ResourceArray constructor.

Parameters

array $items
int $total
int $limit
int $skip

at line 66
int getTotal()

Returns the total amount of resources matching the filter.

Return Value

int

at line 76
int getLimit()

The limit used when retrieving this ResourceArray.

Return Value

int

at line 86
int getSkip()

The number of skipped resources when retrieving this ResourceArray.

Return Value

int

at line 96
ResourceInterface[] getItems()

Get the returned values as a PHP array.

Return Value

ResourceInterface[]

at line 104
SystemPropertiesInterface getSystemProperties()

Returns the resource's system properties, defined in the object "sys" in Contentful's responses.

Creates a Link representation of the current resource.

Return Value

Link

at line 120
string getId()

Shortcut for retrieving the resource ID from the system properties object.

Return Value

string

at line 128
string getType()

Shortcut for retrieving the resource type from the system properties object.

Return Value

string

at line 136
jsonSerialize()

{@inheritdoc}

at line 152
count()

{@inheritdoc}

at line 160
getIterator()

{@inheritdoc}

at line 168
offsetExists($offset)

{@inheritdoc}

Parameters

$offset

at line 176
offsetGet($offset)

{@inheritdoc}

Parameters

$offset

at line 184
offsetSet($offset, $value)

{@inheritdoc}

Parameters

$offset
$value

at line 195
offsetUnset($offset)

{@inheritdoc}

Parameters

$offset