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

ResourceArray constructor.

Parameters

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

at line 61
getTotal()

Returns the total amount of resources matching the filter.

at line 69
getLimit()

The limit used when retrieving this ResourceArray.

at line 77
getSkip()

The number of skipped resources when retrieving this ResourceArray.

at line 87
ResourceInterface[] getItems()

Get the returned values as a PHP array.

Return Value

ResourceInterface[]

at line 95
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 111
getId()

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

at line 119
getType()

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

at line 127
jsonSerialize()

{@inheritdoc}

at line 143
count()

{@inheritdoc}

at line 151
getIterator()

{@inheritdoc}

at line 159
offsetExists($offset)

{@inheritdoc}

Parameters

$offset

at line 167
offsetGet($offset)

{@inheritdoc}

Parameters

$offset

at line 175
offsetSet($offset, $value)

{@inheritdoc}

Parameters

$offset
$value

at line 183
offsetUnset($offset)

{@inheritdoc}

Parameters

$offset