|
@@ 1252-1258 (lines=7) @@
|
| 1249 |
|
); |
| 1250 |
|
|
| 1251 |
|
// check update status |
| 1252 |
|
if ($status['ok'] != 1) { |
| 1253 |
|
throw new \Sokil\Mongo\Exception(sprintf( |
| 1254 |
|
'Update error: %s: %s', |
| 1255 |
|
$status['err'], |
| 1256 |
|
$status['errmsg'] |
| 1257 |
|
)); |
| 1258 |
|
} |
| 1259 |
|
|
| 1260 |
|
// check if document modified due to specified lock |
| 1261 |
|
if ($this->getOption('lock') === Definition::LOCK_OPTIMISTIC) { |
|
@@ 1316-1318 (lines=3) @@
|
| 1313 |
|
'_id' => $this->getId(), |
| 1314 |
|
)); |
| 1315 |
|
|
| 1316 |
|
if(true !== $status && $status['ok'] != 1) { |
| 1317 |
|
throw new \Sokil\Mongo\Exception(sprintf('Delete document error: %s', $status['err'])); |
| 1318 |
|
} |
| 1319 |
|
|
| 1320 |
|
$this->triggerEvent('afterDelete'); |
| 1321 |
|
|