PHP Класс Alcaeus\MongoDbAdapter\AbstractCursor

Наследование: use trait Alcaeus\MongoDbAdapter\Helper\ReadPreference
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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

Описание методов

__construct() публичный метод

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

__sleep() публичный метод

public __sleep ( ) : array
Результат array

batchSize() публичный метод

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

current() публичный метод

Returns the current element
public current ( ) : array
Результат array

dead() публичный метод

Checks if there are documents that have not been sent yet from the database for this cursor
public dead ( ) : boolean
Результат boolean Returns if there are more results that have not been sent to the client, yet.

ensureCursor() абстрактный защищенный метод

abstract protected ensureCursor ( ) : MongoDB\Driver\Cursor
Результат MongoDB\Driver\Cursor

ensureIterator() защищенный метод

protected ensureIterator ( ) : Iterator
Результат Iterator

errorIfOpened() защищенный метод

protected errorIfOpened ( )

getCursorInfo() абстрактный защищенный метод

abstract protected getCursorInfo ( ) : array
Результат array

getIterationInfo() защищенный метод

protected getIterationInfo ( ) : array
Результат array

getOptions() защищенный метод

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)
Результат array

info() публичный метод

public info ( ) : array
Результат array

key() публичный метод

Returns the current result's _id
public key ( ) : string
Результат string The current result's _id as a string.

next() публичный метод

Advances the cursor to the next result, and returns that result
public next ( ) : array
Результат array Returns the next object

notImplemented() защищенный метод

protected notImplemented ( )

reset() защищенный метод

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

rewind() публичный метод

Returns the cursor to the beginning of the result set
public rewind ( ) : void
Результат void

setReadPreference() публичный метод

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

storeIteratorState() защищенный метод

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

timeout() публичный метод

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() публичный метод

Checks if the cursor is reading a valid result.
public valid ( ) : boolean
Результат boolean If the current result is not null.

wrapTraversable() защищенный метод

protected wrapTraversable ( Traversable $traversable ) : Generator
$traversable Traversable
Результат Generator

Описание свойств

$batchSize защищенное свойство

protected int $batchSize
Результат integer

$collection защищенное свойство

protected Collection,MongoDB $collection
Результат MongoDB\Collection

$connection защищенное свойство

protected MongoClient $connection
Результат MongoClient

$cursor защищенное свойство

protected Cursor,MongoDB\Driver $cursor
Результат MongoDB\Driver\Cursor

$cursorNeedsAdvancing защищенное свойство

protected bool $cursorNeedsAdvancing
Результат boolean

$db защищенное свойство

protected Database,MongoDB $db
Результат MongoDB\Database

$iterator защищенное свойство

protected Iterator $iterator
Результат Iterator

$ns защищенное свойство

protected string $ns
Результат string

$optionNames защищенное свойство

protected array $optionNames
Результат array

$position защищенное свойство

protected int $position
Результат integer

$startedIterating защищенное свойство

protected bool $startedIterating
Результат boolean