class ResourceArray implements Countable, ArrayAccess, IteratorAggregate, JsonSerializable

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.

array
getItems()

Get the returned values as a PHP array.

object
jsonSerialize()

Returns an object to be used by json_encode to serialize objects of this class.

int
count()

Returns the number of resources in this array.

getIterator()

Returns a \Traversable to allow iterating the ResourceArray.

bool
offsetExists(mixed $offset)

No description

mixed
offsetGet(mixed $offset)

No description

offsetSet(mixed $offset, mixed $value)

This method is not implemented since a ResourceArray is read-only.

offsetUnset(mixed $offset)

This method is not implemented since a ResourceArray is read-only.

Details

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

ResourceArray constructor.

Parameters

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

at line 60
int getTotal()

Returns the total amount of resources matching the filter.

Return Value

int

at line 70
int getLimit()

The limit used when retrieving this ResourceArray.

Return Value

int

at line 80
int getSkip()

The number of skipped resources when retrieving this ResourceArray.

Return Value

int

at line 90
array getItems()

Get the returned values as a PHP array.

Return Value

array

at line 102
object jsonSerialize()

Returns an object to be used by json_encode to serialize objects of this class.

Return Value

object

See also

http://php.net/manual/en/jsonserializable.jsonserialize.php JsonSerializable::jsonSerialize

at line 122
int count()

Returns the number of resources in this array.

Return Value

int

See also

http://php.net/manual/en/countable.count.php Countable::count

at line 134
Traversable getIterator()

Returns a \Traversable to allow iterating the ResourceArray.

Return Value

Traversable

See also

http://php.net/manual/en/iteratoraggregate.getiterator.php IteratorAggregate::getIterator

at line 146
bool offsetExists(mixed $offset)

Parameters

mixed $offset

Return Value

bool

See also

http://php.net/manual/en/arrayaccess.offsetexists.php ArrayAccess::offsetExists

at line 158
mixed offsetGet(mixed $offset)

Parameters

mixed $offset

Return Value

mixed

See also

http://php.net/manual/en/arrayaccess.offsetget.php ArrayAccess::offsetGet

at line 173
offsetSet(mixed $offset, mixed $value)

This method is not implemented since a ResourceArray is read-only.

Parameters

mixed $offset
mixed $value

Exceptions

BadMethodCallException always thrown since ResourceArray is read-only

See also

http://php.net/manual/en/arrayaccess.offsetset.php ArrayAccess::offsetSet

at line 187
offsetUnset(mixed $offset)

This method is not implemented since a ResourceArray is read-only.

Parameters

mixed $offset

Exceptions

BadMethodCallException always thrown since ResourceArray is read-only

See also

http://php.net/manual/en/arrayaccess.offsetunset.php ArrayAccess::offsetUnset