| @@ 255-270 (lines=16) @@ | ||
| 252 | * |
|
| 253 | * @return bool |
|
| 254 | */ |
|
| 255 | public function commitTransaction(): bool |
|
| 256 | { |
|
| 257 | --$this->transactionLevel; |
|
| 258 | ||
| 259 | if ($this->transactionLevel == 0) { |
|
| 260 | if ($this->isProfiling()) { |
|
| 261 | $this->logger()->info('Commit transaction'); |
|
| 262 | } |
|
| 263 | ||
| 264 | return $this->getPDO()->commit(); |
|
| 265 | } |
|
| 266 | ||
| 267 | $this->savepointRelease($this->transactionLevel + 1); |
|
| 268 | ||
| 269 | return true; |
|
| 270 | } |
|
| 271 | ||
| 272 | /** |
|
| 273 | * Rollback the active database transaction. |
|
| @@ 277-292 (lines=16) @@ | ||
| 274 | * |
|
| 275 | * @return bool |
|
| 276 | */ |
|
| 277 | public function rollbackTransaction(): bool |
|
| 278 | { |
|
| 279 | --$this->transactionLevel; |
|
| 280 | ||
| 281 | if ($this->transactionLevel == 0) { |
|
| 282 | if ($this->isProfiling()) { |
|
| 283 | $this->logger()->info('Rollback transaction'); |
|
| 284 | } |
|
| 285 | ||
| 286 | return $this->getPDO()->rollBack(); |
|
| 287 | } |
|
| 288 | ||
| 289 | $this->savepointRollback($this->transactionLevel + 1); |
|
| 290 | ||
| 291 | return true; |
|
| 292 | } |
|
| 293 | ||
| 294 | /** |
|
| 295 | * Set transaction isolation level, this feature may not be supported by specific database |
|