modified model classes with tests
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user