| @@ 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 | } |
|
| @@ 868-874 (lines=7) @@ | ||
| 865 | $result = $this->_mongoCollection->insert($document); |
|
| 866 | ||
| 867 | // if write concern acknowledged |
|
| 868 | if(is_array($result)) { |
|
| 869 | if($result['ok'] != 1) { |
|
| 870 | throw new Exception('Insert error: ' . $result['err'] . ': ' . $result['errmsg']); |
|
| 871 | } |
|
| 872 | ||
| 873 | return $this; |
|
| 874 | } |
|
| 875 | ||
| 876 | // if write concern unacknowledged |
|
| 877 | if(!$result) { |
|