EagerCursor
class EagerCursor implements CursorInterface (View source)
EagerCursor wraps a Cursor instance and fetches all of its results upon initialization.
Properties
protected CursorInterface | $cursor | The Cursor instance being wrapped. | |
protected array | $data | The Cursor results. | |
protected boolean | $initialized | Whether the internal data has been initialized. |
Methods
No description
No description
Return the wrapped Cursor.
No description
Initialize the internal data by converting the Cursor to an array.
Return whether the internal data has been initialized.
No description
No description
No description
No description
No description
Wrapper method for MongoCursor::addOption().
Wrapper method for MongoCursor::batchSize().
Wrapper method for MongoCursor::dead().
Wrapper method for MongoCursor::explain().
Wrapper method for MongoCursor::fields().
Return the collection for this cursor.
Return the selected fields (projection).
Wrapper method for MongoCursor::getNext().
Return the query criteria.
Wrapper method for MongoCursor::getReadPreference().
Set the read preference.
Return whether the document's "_id" value is used as its iteration key.
Set whether to use the document's "_id" value as its iteration key.
Wrapper method for MongoCursor::hasNext().
Wrapper method for MongoCursor::hint().
Wrapper method for MongoCursor::immortal().
Wrapper method for MongoCursor::info().
Wrapper method for MongoCursor::limit().
{@inheritdoc}
Recreates the internal MongoCursor.
Wrapper method for MongoCursor::reset().
Wrapper method for MongoCursor::skip().
Wrapper method for MongoCursor::slaveOkay().
Wrapper method for MongoCursor::snapshot().
Wrapper method for MongoCursor::sort().
Wrapper method for MongoCursor::tailable().
Wrapper method for MongoCursor::timeout().
Details
at line 49
__construct(CursorInterface $cursor)
Constructor.
at line 57
count()
at line 67
current()
at line 79
CursorInterface
getCursor()
Return the wrapped Cursor.
at line 87
array|object|null
getSingleResult()
at line 101
initialize()
Initialize the internal data by converting the Cursor to an array.
at line 114
boolean
isInitialized()
Return whether the internal data has been initialized.
at line 122
key()
at line 133
next()
at line 143
rewind()
at line 153
array
toArray()
at line 163
valid()
at line 174
$this
addOption(string $key, mixed $value)
Wrapper method for MongoCursor::addOption().
at line 184
$this
batchSize(integer $num)
Wrapper method for MongoCursor::batchSize().
at line 194
boolean
dead()
Wrapper method for MongoCursor::dead().
at line 202
array
explain()
Wrapper method for MongoCursor::explain().
at line 210
$this
fields(array $f)
Wrapper method for MongoCursor::fields().
at line 220
Collection
getCollection()
Return the collection for this cursor.
at line 228
array
getFields()
Return the selected fields (projection).
at line 236
array|null
getNext()
Wrapper method for MongoCursor::getNext().
at line 249
array
getQuery()
Return the query criteria.
at line 257
array
getReadPreference()
Wrapper method for MongoCursor::getReadPreference().
at line 265
$this
setReadPreference(string $readPreference, array $tags = null)
Set the read preference.
at line 275
boolean
getUseIdentifierKeys()
Return whether the document's "_id" value is used as its iteration key.
at line 283
$this
setUseIdentifierKeys(boolean $useIdentifierKeys)
Set whether to use the document's "_id" value as its iteration key.
at line 293
boolean
hasNext()
Wrapper method for MongoCursor::hasNext().
at line 313
$this
hint(array|string $keyPattern)
Wrapper method for MongoCursor::hint().
at line 323
$this
immortal(boolean $liveForever = true)
Wrapper method for MongoCursor::immortal().
at line 333
array
info()
Wrapper method for MongoCursor::info().
at line 341
$this
limit(integer $num)
Wrapper method for MongoCursor::limit().
at line 351
maxTimeMS($ms)
{@inheritdoc}
at line 365
recreate()
Recreates the internal MongoCursor.
at line 376
reset()
Wrapper method for MongoCursor::reset().
at line 384
$this
skip(integer $num)
Wrapper method for MongoCursor::skip().
at line 394
$this
slaveOkay(boolean $ok = true)
Wrapper method for MongoCursor::slaveOkay().
at line 404
$this
snapshot()
Wrapper method for MongoCursor::snapshot().
at line 414
$this
sort(array $fields)
Wrapper method for MongoCursor::sort().
at line 424
$this
tailable(boolean $tail = true)
Wrapper method for MongoCursor::tailable().
at line 434
$this
timeout(integer $ms)
Wrapper method for MongoCursor::timeout().