@@ 1100-1106 (lines=7) @@ | ||
1097 | ); |
|
1098 | ||
1099 | // check update status |
|
1100 | if ($status['ok'] != 1) { |
|
1101 | throw new \Sokil\Mongo\Exception(sprintf( |
|
1102 | 'Update error: %s: %s', |
|
1103 | $status['err'], |
|
1104 | $status['errmsg'] |
|
1105 | )); |
|
1106 | } |
|
1107 | ||
1108 | // check if document modified due to specified lock |
|
1109 | if ($this->getOption('lock') === Definition::LOCK_OPTIMISTIC) { |
|
@@ 1164-1166 (lines=3) @@ | ||
1161 | '_id' => $this->getId(), |
|
1162 | )); |
|
1163 | ||
1164 | if(true !== $status && $status['ok'] != 1) { |
|
1165 | throw new \Sokil\Mongo\Exception(sprintf('Delete document error: %s', $status['err'])); |
|
1166 | } |
|
1167 | ||
1168 | $this->triggerEvent('afterDelete'); |
|
1169 |