class ArrayIterator implements Iterator, ArrayAccess (View source)

ArrayIterator is used to encapsulate document results from commands.

Methods

__construct(array $elements = [])

Constructor.

count()

No description

current()

No description

array|object|boolean
first()

Return the first element in the array, or false if the array is empty.

array|null
getCommandResult()

Get the full result document for the MongoDB command (if available).

setCommandResult(array $commandResult)

Set the full result document for the MongoDB command.

array|object|null
getSingleResult()

No description

key()

No description

array|object|boolean
last()

Return the last element in the array, or false if the array is empty.

next()

No description

offsetExists($offset)

No description

offsetGet($offset)

No description

offsetSet($offset, $value)

No description

offsetUnset($offset)

No description

reset()

Alias of {@link ArrayIterator::rewind()}.

rewind()

No description

array
toArray()

No description

valid()

No description

Details

__construct(array $elements = [])

Constructor.

Parameters

array $elements

array|object|boolean first()

Return the first element in the array, or false if the array is empty.

Return Value

array|object|boolean

See also

http://php.net/manual/en/function.reset.php

array|null getCommandResult()

Get the full result document for the MongoDB command (if available).

Return Value

array|null

setCommandResult(array $commandResult)

Set the full result document for the MongoDB command.

Parameters

array $commandResult

array|object|null getSingleResult()

Return Value

array|object|null

See also

Iterator::getSingleResult

array|object|boolean last()

Return the last element in the array, or false if the array is empty.

Return Value

array|object|boolean

See also

http://php.net/manual/en/function.end.php

offsetExists($offset)

offsetGet($offset)

offsetSet($offset, $value)

Parameters

$offset
$value

See also

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

offsetUnset($offset)

reset()

Alias of {@link ArrayIterator::rewind()}.

array toArray()

Return Value

array

See also

Iterator::toArray