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

@ -92,9 +92,13 @@ class InsertMongoCommand extends MongoDbCommand
protected $safe = true;
protected $insertId = false;
protected function concreteExecute()
{
return $this->collection->insert($this->data, array('safe' => $this->safe));
$result = $this->collection->insert($this->data, array('safe' => $this->safe));
$this->insertId = $this->data['_id'];
return $result;
}
protected function checkParams()
@ -105,6 +109,11 @@ class InsertMongoCommand extends MongoDbCommand
return false;
}
}
public function getInsertId()
{
return $this->insertId;
}
}
class UpdateMongoCommand extends MongoDbCommand