Property | Type | Description | |
---|---|---|---|
$entitySchema | string | Schema that describes the entity that will be retrieved when iterating through the cursor. |
Property | Type | Description | |
---|---|---|---|
$assembler | Have the responsibility of assembling the data coming from the database into actual entities. | ||
$collection | MongoDB\Collection | ||
$command | string | The command that is being called in the $collection. | |
$converter | Object responsible to convert domain objects to mongo objects and vice versa. | ||
$cursor | MongoDB\Driver\Cursor | The MongoDB cursor used to interact with db. | |
$params | array | The parameters of the $command. | |
$position | integer | Iterator position (to be used with foreach). |
Method | Description | |
---|---|---|
__construct ( |
||
all ( ) : array | Convert the cursor instance to an array of Objects. | |
count ( ) : integer | Counts the number of results for this cursor. | |
current ( ) : mixed | Iterator interface current. Return a model object with cursor document. (used in foreach). | |
disableTimeout ( boolean $flag = true ) : |
Disable idle timeout of 10 minutes from MongoDB cursor. | |
first ( ) : mixed | Returns the first element of the cursor. | |
fresh ( ) : void | Refresh the cursor in order to be able to perform a rewind and iterate through it again. A new request to the database will be made in the next iteration. | |
key ( ) : integer | Iterator key method (used in foreach). | |
limit ( integer $amount ) : |
Limits the number of results returned. | |
next ( ) : void | Iterator next method (used in foreach). | |
rewind ( ) : void | Iterator interface rewind (used in foreach). | |
serialize ( ) : string | Serializes this object storing the collection name instead of the actual MongoDb\Collection (which is unserializable). | |
skip ( integer $amount ) : |
Skips a number of results. | |
sort ( array $fields ) : |
Sorts the results by given fields. | |
toArray ( ) : array | Convert the cursor instance to a full associative array. | |
unserialize ( mixed $serialized ) : void | Unserializes this object. Re-creating the database connection. | |
valid ( ) : boolean | Iterator valid method (used in foreach). |
Method | Description | |
---|---|---|
getAssembler ( ) : |
Retrieves an EntityAssembler instance. | |
getConverter ( ) : |
Converter is responsible to convert domain objects to mongo objects and vice versa. | |
getCursor ( ) : Traversable | Actually returns a Traversable object with the DriverCursor within. |
public __construct ( |
||
$entitySchema | Schema that describes the entity that will be retrieved from the database. | |
$collection | MongoDB\Collection | The raw collection object that will be used to retrieve the documents. |
$command | string | The command that is being called in the $collection. |
$params | array | The parameters of the $command. |
public disableTimeout ( boolean $flag = true ) : |
||
$flag | boolean | Toggle timeout on or off. |
return | Returns this cursor. |
protected getAssembler ( ) : |
||
return |
protected getConverter ( ) : |
||
return |
protected getCursor ( ) : Traversable | ||
return | Traversable |
public unserialize ( mixed $serialized ) : void | ||
$serialized | mixed | Serialized cursor. |
return | void |
protected EntityAssembler,Mongolid\DataMapper $assembler | ||
return |
protected string $command | ||
return | string |
protected Converter,Mongolid\Serializer\Type $converter | ||
return |
protected Cursor,MongoDB\Driver $cursor | ||
return | MongoDB\Driver\Cursor |
public string $entitySchema | ||
return | string |
protected int $position | ||
return | integer |