PHP Interface Mongolid\Cursor\CursorInterface

Inheritance: extends Iterato\Iterator
Afficher le fichier Open project: leroy-merlin-br/mongolid

Méthodes publiques

Méthode Description
all ( ) : array Convert the cursor instance to an array of Items.
count ( ) : integer Counts the number of results for this cursor.
first ( ) : mixed Returns the first element of the cursor.
limit ( integer $amount ) : Mongolid\Cursor\CursorInterface Limits the number of results returned.
skip ( integer $amount ) : Mongolid\Cursor\CursorInterface Skips a number of results.
sort ( array $fields ) : Mongolid\Cursor\CursorInterface Sorts the results by given fields.
toArray ( ) : array Return the raw cursor items.

Method Details

all() public méthode

Convert the cursor instance to an array of Items.
public all ( ) : array
Résultat array

count() public méthode

Counts the number of results for this cursor.
public count ( ) : integer
Résultat integer The number of documents returned by this cursor's query.

first() public méthode

Returns the first element of the cursor.
public first ( ) : mixed
Résultat mixed

limit() public méthode

Limits the number of results returned.
public limit ( integer $amount ) : Mongolid\Cursor\CursorInterface
$amount integer The number of results to return.
Résultat Mongolid\Cursor\CursorInterface Returns this cursor.

skip() public méthode

Skips a number of results.
public skip ( integer $amount ) : Mongolid\Cursor\CursorInterface
$amount integer The number of results to skip.
Résultat Mongolid\Cursor\CursorInterface Returns this cursor.

sort() public méthode

Sorts the results by given fields.
public sort ( array $fields ) : Mongolid\Cursor\CursorInterface
$fields array An array of fields by which to sort. Each element in the array has as key the field name, and as value either 1 for ascending sort, or -1 for descending sort.
Résultat Mongolid\Cursor\CursorInterface Returns this cursor.

toArray() public méthode

Return the raw cursor items.
public toArray ( ) : array
Résultat array