@@ 1116-1122 (lines=7) @@ | ||
1113 | ); |
|
1114 | ||
1115 | // check update status |
|
1116 | if ($status['ok'] != 1) { |
|
1117 | throw new \Sokil\Mongo\Exception(sprintf( |
|
1118 | 'Update error: %s: %s', |
|
1119 | $status['err'], |
|
1120 | $status['errmsg'] |
|
1121 | )); |
|
1122 | } |
|
1123 | ||
1124 | // check if document modified due to specified lock |
|
1125 | if ($this->getOption('lock') === Definition::LOCK_OPTIMISTIC) { |
|
@@ 1180-1182 (lines=3) @@ | ||
1177 | '_id' => $this->getId(), |
|
1178 | )); |
|
1179 | ||
1180 | if(true !== $status && $status['ok'] != 1) { |
|
1181 | throw new \Sokil\Mongo\Exception(sprintf('Delete document error: %s', $status['err'])); |
|
1182 | } |
|
1183 | ||
1184 | $this->triggerEvent('afterDelete'); |
|
1185 |