added butchInsert to mongo model
This commit is contained in:
@ -32,18 +32,23 @@ abstract class MongoModel extends Model
|
||||
|
||||
public function get($id)
|
||||
{
|
||||
if($this->useMongoId) {
|
||||
if(! $id instanceof MongoId) {
|
||||
if ($this->useMongoId) {
|
||||
if (!$id instanceof MongoId) {
|
||||
$id = new MongoId($id);
|
||||
}
|
||||
}
|
||||
return $this->db->get($this->table(), array('_id' => $id))->fetch();
|
||||
}
|
||||
|
||||
public function batchInsert($data)
|
||||
{
|
||||
return $this->db->insert($this->table(), $data, true);
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
if($this->useMongoId) {
|
||||
if(! $id instanceof MongoId) {
|
||||
if ($this->useMongoId) {
|
||||
if (!$id instanceof MongoId) {
|
||||
$id = new MongoId($id);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user