| @@ 488-503 (lines=16) @@ | ||
| 485 | * |
|
| 486 | * @return bool |
|
| 487 | */ |
|
| 488 | public function commitTransaction(): bool |
|
| 489 | { |
|
| 490 | --$this->transactionLevel; |
|
| 491 | ||
| 492 | if ($this->transactionLevel == 0) { |
|
| 493 | if ($this->isProfiling()) { |
|
| 494 | $this->logger()->info('Commit transaction'); |
|
| 495 | } |
|
| 496 | ||
| 497 | return $this->getPDO()->commit(); |
|
| 498 | } |
|
| 499 | ||
| 500 | $this->savepointRelease($this->transactionLevel + 1); |
|
| 501 | ||
| 502 | return true; |
|
| 503 | } |
|
| 504 | ||
| 505 | /** |
|
| 506 | * Rollback the active database transaction. |
|
| @@ 510-525 (lines=16) @@ | ||
| 507 | * |
|
| 508 | * @return bool |
|
| 509 | */ |
|
| 510 | public function rollbackTransaction(): bool |
|
| 511 | { |
|
| 512 | --$this->transactionLevel; |
|
| 513 | ||
| 514 | if ($this->transactionLevel == 0) { |
|
| 515 | if ($this->isProfiling()) { |
|
| 516 | $this->logger()->info('Rollback transaction'); |
|
| 517 | } |
|
| 518 | ||
| 519 | return $this->getPDO()->rollBack(); |
|
| 520 | } |
|
| 521 | ||
| 522 | $this->savepointRollback($this->transactionLevel + 1); |
|
| 523 | ||
| 524 | return true; |
|
| 525 | } |
|
| 526 | ||
| 527 | /** |
|
| 528 | * @return array |
|