Sokil\Mongo\Collection::insertMultiple PHP Method

insertMultiple() public method

Deprecation: since 1.13 Use Collection::batchInsert()
public insertMultiple ( $rows, $validate = true )
    public function insertMultiple($rows, $validate = true)
    {
        return $this->batchInsert($rows, $validate);
    }

Usage Example

Beispiel #1
0
 /**
  * @expectedException \Sokil\Mongo\Exception
  * @expectedExceptionMessage Batch insert error
  */
 public function testInsertMultiple_ErrorInsertingWithUnacknowledgeWrite()
 {
     $this->collectionMock = $this->getMock('\\MongoCollection', array('batchInsert'), array($this->database->getMongoDB(), 'phpmongo_test_collection'));
     $this->collectionMock->expects($this->once())->method('batchInsert')->will($this->returnValue(false));
     $this->collection = new Collection($this->database, $this->collectionMock);
     // insert multiple
     $this->collection->insertMultiple(array(array('a' => 1, 'b' => 2), array('a' => 3, 'b' => 4)));
 }
All Usage Examples Of Sokil\Mongo\Collection::insertMultiple