@@ 1137-1143 (lines=7) @@ | ||
1134 | ); |
|
1135 | ||
1136 | // check update status |
|
1137 | if ($status['ok'] != 1) { |
|
1138 | throw new \Sokil\Mongo\Exception(sprintf( |
|
1139 | 'Update error: %s: %s', |
|
1140 | $status['err'], |
|
1141 | $status['errmsg'] |
|
1142 | )); |
|
1143 | } |
|
1144 | ||
1145 | // check if document modified due to specified lock |
|
1146 | if ($this->getOption('lock') === Definition::LOCK_OPTIMISTIC) { |
|
@@ 1201-1203 (lines=3) @@ | ||
1198 | '_id' => $this->getId(), |
|
1199 | )); |
|
1200 | ||
1201 | if(true !== $status && $status['ok'] != 1) { |
|
1202 | throw new \Sokil\Mongo\Exception(sprintf('Delete document error: %s', $status['err'])); |
|
1203 | } |
|
1204 | ||
1205 | $this->triggerEvent('afterDelete'); |
|
1206 |