modified model classes with tests

This commit is contained in:
Anton Grebnev
2011-11-17 15:12:47 +04:00
parent e740ae7000
commit 7e8fe0f94d
10 changed files with 212 additions and 85 deletions

View File

@ -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;
}
}