|
@@ 1023-1029 (lines=7) @@
|
| 1020 |
|
); |
| 1021 |
|
|
| 1022 |
|
// check update status |
| 1023 |
|
if ($status['ok'] != 1) { |
| 1024 |
|
throw new \Sokil\Mongo\Exception(sprintf( |
| 1025 |
|
'Update error: %s: %s', |
| 1026 |
|
$status['err'], |
| 1027 |
|
$status['errmsg'] |
| 1028 |
|
)); |
| 1029 |
|
} |
| 1030 |
|
|
| 1031 |
|
// check if document modified due to specified lock |
| 1032 |
|
if ($this->getOption('lock') === Definition::LOCK_OPTIMISTIC) { |
|
@@ 1087-1089 (lines=3) @@
|
| 1084 |
|
'_id' => $this->getId(), |
| 1085 |
|
)); |
| 1086 |
|
|
| 1087 |
|
if(true !== $status && $status['ok'] != 1) { |
| 1088 |
|
throw new \Sokil\Mongo\Exception(sprintf('Delete document error: %s', $status['err'])); |
| 1089 |
|
} |
| 1090 |
|
|
| 1091 |
|
$this->triggerEvent('afterDelete'); |
| 1092 |
|
|