| 1 | <?php |
||
| 16 | class BatchInsert extends BatchOperation |
||
| 17 | { |
||
| 18 | protected $batchClass = '\MongoInsertBatch'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var bool |
||
| 22 | */ |
||
| 23 | private $isValidationEnabled = true; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Used for validating array of data |
||
| 27 | * @var Document |
||
| 28 | */ |
||
| 29 | private $validator; |
||
| 30 | |||
| 31 | public function init() |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return $this |
||
| 38 | */ |
||
| 39 | public function enableValidation() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return $this |
||
| 47 | */ |
||
| 48 | public function disableValidation() |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return bool |
||
| 56 | */ |
||
| 57 | public function isValidationEnabled() |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param array $document |
||
| 64 | * @return $this |
||
| 65 | * @throws InvalidDocumentException |
||
| 66 | */ |
||
| 67 | public function insert(array $document) |
||
| 83 | } |
||
| 84 |