PHP Class Mongolid\Cursor\CacheableCursor

Inheritance: extends Cursor
Afficher le fichier Open project: leroy-merlin-br/mongolid

Protected Properties

Свойство Type Description
$documents array The documents that were retrieved from the database in a serializable way.
$ignoreCache boolean Means that the CacheableCursor is wapping the original cursor and not reading from Cache anymore.
$originalLimit ìnteger Limit of the query. It is stored because when caching the documents the DOCUMENT_LIMIT const will be used.

Méthodes publiques

Méthode Description
serialize ( ) : string Serializes this object. Drops the unserializable DriverCursor. In order to make the CacheableCursor object serializable.

Méthodes protégées

Méthode Description
generateCacheKey ( ) : string Generates an unique cache key for the cursor in it's current state.
getCursor ( ) : Traversable Actually returns a Traversable object with the DriverCursor within.
getLimit ( ) : mixed Gets the limit clause of the query if any.
getOriginalCursor ( ) : Traversable Returns the DriverCursor considering the documents that have already been retrieved from cache.
storeOriginalLimit ( ) : void Stores the original "limit" clause of the query.

Method Details

generateCacheKey() protected méthode

Generates an unique cache key for the cursor in it's current state.
protected generateCacheKey ( ) : string
Résultat string Cache key to identify the query of the current cursor.

getCursor() protected méthode

If it does not exists yet, create it using the $collection, $command and $params given. The difference between the CacheableCursor and the normal Cursor is that the Cacheable stores all the results within itself and drops the Driver Cursor in order to be serializable.
protected getCursor ( ) : Traversable
Résultat Traversable

getLimit() protected méthode

Gets the limit clause of the query if any.
protected getLimit ( ) : mixed
Résultat mixed Int or null

getOriginalCursor() protected méthode

Returns the DriverCursor considering the documents that have already been retrieved from cache.
protected getOriginalCursor ( ) : Traversable
Résultat Traversable

serialize() public méthode

Serializes this object. Drops the unserializable DriverCursor. In order to make the CacheableCursor object serializable.
public serialize ( ) : string
Résultat string Serialized object.

storeOriginalLimit() protected méthode

Stores the original "limit" clause of the query.
protected storeOriginalLimit ( ) : void
Résultat void

Property Details

$documents protected_oe property

The documents that were retrieved from the database in a serializable way.
protected array $documents
Résultat array

$ignoreCache protected_oe property

Means that the CacheableCursor is wapping the original cursor and not reading from Cache anymore.
protected bool $ignoreCache
Résultat boolean

$originalLimit protected_oe property

Limit of the query. It is stored because when caching the documents the DOCUMENT_LIMIT const will be used.
protected ìnteger $originalLimit
Résultat ìnteger