added MongoStatement method to count results before skip/limit
This commit is contained in:
@ -16,6 +16,15 @@ class MongoStatement extends DbStatement
|
||||
|
||||
protected $insertId = false;
|
||||
|
||||
public function count()
|
||||
{
|
||||
if ($this->result instanceof MongoCursor) {
|
||||
return $this->result->count();
|
||||
} else {
|
||||
throw new GeneralException('MongoStatement error. Impossible count result of opened cursor.');
|
||||
}
|
||||
}
|
||||
|
||||
public function order($sort = array())
|
||||
{
|
||||
if ($this->result instanceof MongoCursor) {
|
||||
|
Reference in New Issue
Block a user