| @@ 119-121 (lines=3) @@ | ||
| 116 | $result = $this->getMongoCollection()->delete($id); |
|
| 117 | } |
|
| 118 | } |
|
| 119 | if ($result['ok'] !== (double) 1) { |
|
| 120 | throw new Exception('Error deleting file: ' . $result['err'] . ': ' . $result['errmsg']); |
|
| 121 | } |
|
| 122 | ||
| 123 | return $this; |
|
| 124 | } |
|
| @@ 869-875 (lines=7) @@ | ||
| 866 | $result = $this->getMongoCollection()->insert($document); |
|
| 867 | ||
| 868 | // if write concern acknowledged |
|
| 869 | if (is_array($result)) { |
|
| 870 | if ($result['ok'] != 1) { |
|
| 871 | throw new Exception('Insert error: ' . $result['err'] . ': ' . $result['errmsg']); |
|
| 872 | } |
|
| 873 | ||
| 874 | return $this; |
|
| 875 | } |
|
| 876 | ||
| 877 | // if write concern unacknowledged |
|
| 878 | if (!$result) { |
|