Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| AbstractManager | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| isTransaction | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| getTransactionDepth | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| enter | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| leave | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| 1 | <?php |
| 2 | /** |
| 3 | * Pop PHP Framework (https://www.popphp.org/) |
| 4 | * |
| 5 | * @link https://github.com/popphp/popphp-framework |
| 6 | * @author Nick Sagona, III <dev@noladev.com> |
| 7 | * @copyright Copyright (c) 2009-2026 NOLA Interactive, LLC. |
| 8 | * @license https://www.popphp.org/license New BSD License |
| 9 | */ |
| 10 | |
| 11 | /** |
| 12 | * @namespace |
| 13 | */ |
| 14 | namespace Pop\Db\Adapter\Transaction; |
| 15 | |
| 16 | /** |
| 17 | * Db adapter transaction manager abstract class |
| 18 | * |
| 19 | * @category Pop |
| 20 | * @package Pop\Db |
| 21 | * @author Nick Sagona, III <dev@noladev.com> |
| 22 | * @author Martok <martok@martoks-place.de> |
| 23 | * @copyright Copyright (c) 2009-2026 NOLA Interactive, LLC. |
| 24 | * @license https://www.popphp.org/license New BSD License |
| 25 | * @version 6.7.0 |
| 26 | */ |
| 27 | abstract class AbstractManager implements ManagerInterface |
| 28 | { |
| 29 | |
| 30 | /** |
| 31 | * Check if adapter is in the middle of an open transaction |
| 32 | * |
| 33 | * @return bool |
| 34 | */ |
| 35 | abstract public function isTransaction(): bool; |
| 36 | |
| 37 | /** |
| 38 | * Get transaction depth |
| 39 | * |
| 40 | * @return int |
| 41 | */ |
| 42 | abstract public function getTransactionDepth(): int; |
| 43 | |
| 44 | /** |
| 45 | * Enter a new transaction or increase nesting level |
| 46 | * |
| 47 | * @param ?callable $beginFunc Called when a new top-level transaction must be started |
| 48 | * @param ?callable $savepointFunc Called when a named savepoint is created |
| 49 | * @return bool |
| 50 | */ |
| 51 | abstract public function enter(?callable $beginFunc = null, ?callable $savepointFunc = null): bool; |
| 52 | |
| 53 | /** |
| 54 | * Leave a transaction or reduce nesting level |
| 55 | * |
| 56 | * @param bool $doCommit If true, perform a commit. Rollback otherwise. |
| 57 | * @param ?callable $commitFunc Called when a top-level commit must be performed |
| 58 | * @param ?callable $rollbackFunc Called when a top-level rollback must be performed |
| 59 | * @param ?callable $savepointReleaseFunc Called when a savepoint is released (like commit) |
| 60 | * @param ?callable $savepointRollbackFunc Called when the transaction is rolled back to a savepoint |
| 61 | * @return bool |
| 62 | */ |
| 63 | abstract public function leave(bool $doCommit, |
| 64 | ?callable $commitFunc = null, ?callable $rollbackFunc = null, |
| 65 | ?callable $savepointReleaseFunc = null, ?callable $savepointRollbackFunc = null): bool; |
| 66 | |
| 67 | } |