modified model classes with tests
This commit is contained in:
@ -14,6 +14,8 @@
|
||||
class MongoStatement extends DbStatement
|
||||
{
|
||||
|
||||
protected $insertId = false;
|
||||
|
||||
public function order($sort = array())
|
||||
{
|
||||
if ($this->result instanceof MongoCursor) {
|
||||
@ -133,6 +135,9 @@ class MongoStatement extends DbStatement
|
||||
if ($result instanceof MongoCursor || is_array($result)) {
|
||||
$this->result = $result;
|
||||
}
|
||||
if($request instanceof InsertMongoCommand) {
|
||||
$this->insertId = $request->getInsertId();
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
throw new Exception('No connection to MongoDB server.');
|
||||
@ -148,4 +153,9 @@ class MongoStatement extends DbStatement
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function getInsertId()
|
||||
{
|
||||
return $this->insertId;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user