PHP Class Alcaeus\MongoDbAdapter\AbstractCursor

Inheritance: use trait Alcaeus\MongoDbAdapter\Helper\ReadPreference
Afficher le fichier Open project: alcaeus/mongo-php-adapter Class Usage Examples

Protected Properties

Свойство Type Description
$batchSize integer
$collection MongoDB\Collection
$connection MongoClient
$cursor MongoDB\Driver\Cursor
$cursorNeedsAdvancing boolean
$db MongoDB\Database
$iterator Iterator
$ns string
$optionNames array
$position integer
$startedIterating boolean

Méthodes publiques

Méthode Description
__construct ( MongoClient $connection, string $ns ) Create a new cursor
__sleep ( ) : array
batchSize ( integer $batchSize ) Limits the number of elements returned in one batch.
current ( ) : array Returns the current element
dead ( ) : boolean Checks if there are documents that have not been sent yet from the database for this cursor
info ( ) : array
key ( ) : string Returns the current result's _id
next ( ) : array Advances the cursor to the next result, and returns that result
rewind ( ) : void Returns the cursor to the beginning of the result set
setReadPreference ( string $readPreference, array $tags = null )
timeout ( integer $ms ) Sets a client-side timeout for this query
valid ( ) : boolean Checks if the cursor is reading a valid result.

Méthodes protégées

Méthode Description
ensureCursor ( ) : MongoDB\Driver\Cursor
ensureIterator ( ) : Iterator
errorIfOpened ( )
getCursorInfo ( ) : array
getIterationInfo ( ) : array
getOptions ( array $optionNames = null ) : array Applies all options set on the cursor, overwriting any options that have already been set
notImplemented ( )
reset ( ) Clears the cursor
storeIteratorState ( ) Stores the current cursor element.
wrapTraversable ( Traversable $traversable ) : Generator

Method Details

__construct() public méthode

Create a new cursor
public __construct ( MongoClient $connection, string $ns )
$connection MongoClient Database connection.
$ns string Full name of database and collection.

__sleep() public méthode

public __sleep ( ) : array
Résultat array

batchSize() public méthode

Limits the number of elements returned in one batch.
public batchSize ( integer $batchSize )
$batchSize integer The number of results to return per batch

current() public méthode

Returns the current element
public current ( ) : array
Résultat array

dead() public méthode

Checks if there are documents that have not been sent yet from the database for this cursor
public dead ( ) : boolean
Résultat boolean Returns if there are more results that have not been sent to the client, yet.

ensureCursor() abstract protected méthode

abstract protected ensureCursor ( ) : MongoDB\Driver\Cursor
Résultat MongoDB\Driver\Cursor

ensureIterator() protected méthode

protected ensureIterator ( ) : Iterator
Résultat Iterator

errorIfOpened() protected méthode

protected errorIfOpened ( )

getCursorInfo() abstract protected méthode

abstract protected getCursorInfo ( ) : array
Résultat array

getIterationInfo() protected méthode

protected getIterationInfo ( ) : array
Résultat array

getOptions() protected méthode

Applies all options set on the cursor, overwriting any options that have already been set
protected getOptions ( array $optionNames = null ) : array
$optionNames array Array of option names to be applied (will be read from properties)
Résultat array

info() public méthode

public info ( ) : array
Résultat array

key() public méthode

Returns the current result's _id
public key ( ) : string
Résultat string The current result's _id as a string.

next() public méthode

Advances the cursor to the next result, and returns that result
public next ( ) : array
Résultat array Returns the next object

notImplemented() protected méthode

protected notImplemented ( )

reset() protected méthode

This is generic but implemented as protected since it's only exposed in MongoCursor
protected reset ( )

rewind() public méthode

Returns the cursor to the beginning of the result set
public rewind ( ) : void
Résultat void

setReadPreference() public méthode

public setReadPreference ( string $readPreference, array $tags = null )
$readPreference string
$tags array

storeIteratorState() protected méthode

This is necessary because hasNext() might advance the iterator but we still need to be able to return the current object.
protected storeIteratorState ( )

timeout() public méthode

Sets a client-side timeout for this query
public timeout ( integer $ms )
$ms integer The number of milliseconds for the cursor to wait for a response. By default, the cursor will wait forever.

valid() public méthode

Checks if the cursor is reading a valid result.
public valid ( ) : boolean
Résultat boolean If the current result is not null.

wrapTraversable() protected méthode

protected wrapTraversable ( Traversable $traversable ) : Generator
$traversable Traversable
Résultat Generator

Property Details

$batchSize protected_oe property

protected int $batchSize
Résultat integer

$collection protected_oe property

protected Collection,MongoDB $collection
Résultat MongoDB\Collection

$connection protected_oe property

protected MongoClient $connection
Résultat MongoClient

$cursor protected_oe property

protected Cursor,MongoDB\Driver $cursor
Résultat MongoDB\Driver\Cursor

$cursorNeedsAdvancing protected_oe property

protected bool $cursorNeedsAdvancing
Résultat boolean

$db protected_oe property

protected Database,MongoDB $db
Résultat MongoDB\Database

$iterator protected_oe property

protected Iterator $iterator
Résultat Iterator

$ns protected_oe property

protected string $ns
Résultat string

$optionNames protected_oe property

protected array $optionNames
Résultat array

$position protected_oe property

protected int $position
Résultat integer

$startedIterating protected_oe property

protected bool $startedIterating
Résultat boolean