|
@@ 1131-1137 (lines=7) @@
|
| 1128 |
|
); |
| 1129 |
|
|
| 1130 |
|
// check update status |
| 1131 |
|
if ($status['ok'] != 1) { |
| 1132 |
|
throw new \Sokil\Mongo\Exception(sprintf( |
| 1133 |
|
'Update error: %s: %s', |
| 1134 |
|
$status['err'], |
| 1135 |
|
$status['errmsg'] |
| 1136 |
|
)); |
| 1137 |
|
} |
| 1138 |
|
|
| 1139 |
|
// check if document modified due to specified lock |
| 1140 |
|
if ($this->getOption('lock') === Definition::LOCK_OPTIMISTIC) { |
|
@@ 1195-1197 (lines=3) @@
|
| 1192 |
|
'_id' => $this->getId(), |
| 1193 |
|
)); |
| 1194 |
|
|
| 1195 |
|
if(true !== $status && $status['ok'] != 1) { |
| 1196 |
|
throw new \Sokil\Mongo\Exception(sprintf('Delete document error: %s', $status['err'])); |
| 1197 |
|
} |
| 1198 |
|
|
| 1199 |
|
$this->triggerEvent('afterDelete'); |
| 1200 |
|
|