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.

getTotal()

Returns the total amount of resources matching the filter.

getLimit()

The limit used when retrieving this ResourceArray.

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.

getId()

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

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 48
__construct(array $items, int $total, int $limit, int $skip)

ResourceArray constructor.

Parameters

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

at line 59
getTotal()

Returns the total amount of resources matching the filter.

at line 67
getLimit()

The limit used when retrieving this ResourceArray.

at line 75
getSkip()

The number of skipped resources when retrieving this ResourceArray.

at line 85
ResourceInterface[] getItems()

Get the returned values as a PHP array.

Return Value

ResourceInterface[]

at line 93
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.

at line 109
getId()

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

at line 117
getType()

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

at line 125
jsonSerialize()

{@inheritdoc}

at line 141
count()

{@inheritdoc}

at line 149
getIterator()

{@inheritdoc}

at line 157
offsetExists($offset)

{@inheritdoc}

Parameters

$offset

at line 165
offsetGet($offset)

{@inheritdoc}

Parameters

$offset

at line 173
offsetSet($offset, $value)

{@inheritdoc}

Parameters

$offset
$value

at line 181
offsetUnset($offset)

{@inheritdoc}

Parameters

$offset