| @@ 247-262 (lines=16) @@ | ||
| 244 | * |
|
| 245 | * @return bool |
|
| 246 | */ |
|
| 247 | public function commitTransaction(): bool |
|
| 248 | { |
|
| 249 | --$this->transactionLevel; |
|
| 250 | ||
| 251 | if ($this->transactionLevel == 0) { |
|
| 252 | if ($this->isProfiling()) { |
|
| 253 | $this->logger()->info('Commit transaction'); |
|
| 254 | } |
|
| 255 | ||
| 256 | return $this->getPDO()->commit(); |
|
| 257 | } |
|
| 258 | ||
| 259 | $this->savepointRelease($this->transactionLevel + 1); |
|
| 260 | ||
| 261 | return true; |
|
| 262 | } |
|
| 263 | ||
| 264 | /** |
|
| 265 | * Rollback the active database transaction. |
|
| @@ 269-284 (lines=16) @@ | ||
| 266 | * |
|
| 267 | * @return bool |
|
| 268 | */ |
|
| 269 | public function rollbackTransaction(): bool |
|
| 270 | { |
|
| 271 | --$this->transactionLevel; |
|
| 272 | ||
| 273 | if ($this->transactionLevel == 0) { |
|
| 274 | if ($this->isProfiling()) { |
|
| 275 | $this->logger()->info('Rollback transaction'); |
|
| 276 | } |
|
| 277 | ||
| 278 | return $this->getPDO()->rollBack(); |
|
| 279 | } |
|
| 280 | ||
| 281 | $this->savepointRollback($this->transactionLevel + 1); |
|
| 282 | ||
| 283 | return true; |
|
| 284 | } |
|
| 285 | ||
| 286 | /** |
|
| 287 | * Get driver specific factory. |
|