@@ 127-129 (lines=3) @@ | ||
124 | $result = $this->_mongoCollection->delete($id); |
|
125 | } |
|
126 | } |
|
127 | if($result['ok'] !== (double) 1) { |
|
128 | throw new Exception('Error deleting file: ' . $result['err'] . ': ' . $result['errmsg']); |
|
129 | } |
|
130 | ||
131 | return $this; |
|
132 | } |
@@ 832-838 (lines=7) @@ | ||
829 | $result = $this->_mongoCollection->insert($document); |
|
830 | ||
831 | // if write concern acknowledged |
|
832 | if(is_array($result)) { |
|
833 | if($result['ok'] != 1) { |
|
834 | throw new Exception('Insert error: ' . $result['err'] . ': ' . $result['errmsg']); |
|
835 | } |
|
836 | ||
837 | return $this; |
|
838 | } |
|
839 | ||
840 | // if write concern unacknowledged |
|
841 | if(!$result) { |