class CommandCursor implements Iterator (View source)

Wrapper for the CommandCursor class.

Methods

__construct(CommandCursor $commandCursor, UnitOfWork $unitOfWork, ClassMetadata $class = null)

No description

batchSize(integer $num)

Wrapper method for MongoCommandCursor::batchSize().

integer
count()

Recreates the command cursor and counts its results.

object|array|null
current()

Wrapper method for MongoCommandCursor::current().

boolean
dead()

Wrapper method for MongoCommandCursor::dead().

CommandCursor
getBaseCursor()

Returns the MongoCommandCursor instance being wrapped.

object|array|null
getSingleResult()

Rewinds the cursor and returns its first result.

array
info()

Wrapper method for MongoCommandCursor::info().

integer
key()

Wrapper method for MongoCommandCursor::key().

next()

Wrapper method for MongoCommandCursor::next().

array
rewind()

Wrapper method for MongoCommandCursor::rewind().

timeout(integer $ms)

Wrapper method for MongoCommandCursor::timeout().

array
toArray()

Return the cursor's results as an array.

boolean
valid()

Wrapper method for MongoCommandCursor::valid().

Details

__construct(CommandCursor $commandCursor, UnitOfWork $unitOfWork, ClassMetadata $class = null)

Parameters

CommandCursor $commandCursor The ComamndCursor instance being wrapped
UnitOfWork $unitOfWork
ClassMetadata $class The class to use for hydration or null if results should not be hydrated

CommandCursor batchSize(integer $num)

Wrapper method for MongoCommandCursor::batchSize().

Parameters

integer $num

Return Value

CommandCursor

See also

http://php.net/manual/en/mongocommandcursor.batchsize.php

integer count()

Recreates the command cursor and counts its results.

Return Value

integer

See also

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

object|array|null current()

Wrapper method for MongoCommandCursor::current().

boolean dead()

Wrapper method for MongoCommandCursor::dead().

CommandCursor getBaseCursor()

Returns the MongoCommandCursor instance being wrapped.

Return Value

CommandCursor

object|array|null getSingleResult()

Rewinds the cursor and returns its first result.

Return Value

object|array|null

See also

Iterator::getSingleResult()

array info()

Wrapper method for MongoCommandCursor::info().

integer key()

Wrapper method for MongoCommandCursor::key().

next()

array rewind()

Wrapper method for MongoCommandCursor::rewind().

CommandCursor timeout(integer $ms)

Wrapper method for MongoCommandCursor::timeout().

Parameters

integer $ms

Return Value

CommandCursor

Exceptions

BadMethodCallException if MongoCommandCursor::timeout() is not available

See also

http://php.net/manual/en/mongocommandcursor.timeout.php

array toArray()

Return the cursor's results as an array.

Return Value

array

See also

Iterator::toArray()

boolean valid()

Wrapper method for MongoCommandCursor::valid().