|
@@ 849-855 (lines=7) @@
|
| 846 |
|
// If the w parameter is set to acknowledge the write, |
| 847 |
|
// returns an associative array with the status of the inserts ("ok") |
| 848 |
|
// and any error that may have occurred ("err"). |
| 849 |
|
if (is_array($result)) { |
| 850 |
|
if ($result['ok'] != 1) { |
| 851 |
|
throw new Exception('Batch insert error: ' . $result['err']); |
| 852 |
|
} |
| 853 |
|
|
| 854 |
|
return $this; |
| 855 |
|
} |
| 856 |
|
|
| 857 |
|
// Otherwise, returns TRUE if the batch insert was successfully sent, |
| 858 |
|
// FALSE otherwise. |
|
@@ 922-927 (lines=6) @@
|
| 919 |
|
); |
| 920 |
|
|
| 921 |
|
// if write concern acknowledged |
| 922 |
|
if (is_array($result)) { |
| 923 |
|
if ($result['ok'] != 1) { |
| 924 |
|
throw new Exception(sprintf('Update error: %s: %s', $result['err'], $result['errmsg'])); |
| 925 |
|
} |
| 926 |
|
return $this; |
| 927 |
|
} |
| 928 |
|
|
| 929 |
|
// if write concern unacknowledged |
| 930 |
|
if (!$result) { |