|
@@ 832-838 (lines=7) @@
|
| 829 |
|
// If the w parameter is set to acknowledge the write, |
| 830 |
|
// returns an associative array with the status of the inserts ("ok") |
| 831 |
|
// and any error that may have occurred ("err"). |
| 832 |
|
if (is_array($result)) { |
| 833 |
|
if ($result['ok'] != 1) { |
| 834 |
|
throw new Exception('Batch insert error: ' . $result['err']); |
| 835 |
|
} |
| 836 |
|
|
| 837 |
|
return $this; |
| 838 |
|
} |
| 839 |
|
|
| 840 |
|
// Otherwise, returns TRUE if the batch insert was successfully sent, |
| 841 |
|
// FALSE otherwise. |
|
@@ 905-910 (lines=6) @@
|
| 902 |
|
); |
| 903 |
|
|
| 904 |
|
// if write concern acknowledged |
| 905 |
|
if (is_array($result)) { |
| 906 |
|
if ($result['ok'] != 1) { |
| 907 |
|
throw new Exception(sprintf('Update error: %s: %s', $result['err'], $result['errmsg'])); |
| 908 |
|
} |
| 909 |
|
return $this; |
| 910 |
|
} |
| 911 |
|
|
| 912 |
|
// if write concern unacknowledged |
| 913 |
|
if (!$result) { |