Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * Pop PHP Framework (http://www.popphp.org/) |
4 | * |
5 | * @link https://github.com/popphp/popphp-framework |
6 | * @author Nick Sagona, III <dev@nolainteractive.com> |
7 | * @copyright Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
8 | * @license http://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 interface |
18 | * |
19 | * @category Pop |
20 | * @package Pop\Db |
21 | * @author Nick Sagona, III <dev@nolainteractive.com> |
22 | * @author Martok <martok@martoks-place.de> |
23 | * @copyright Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
24 | * @license http://www.popphp.org/license New BSD License |
25 | * @version 6.5.0 |
26 | */ |
27 | interface ManagerInterface |
28 | { |
29 | |
30 | /** |
31 | * Check if adapter is in the middle of an open transaction |
32 | * |
33 | * @return bool |
34 | */ |
35 | public function isTransaction(): bool; |
36 | |
37 | /** |
38 | * Get transaction depth |
39 | * |
40 | * @return int |
41 | */ |
42 | 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 | 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 | public function leave(bool $doCommit, |
64 | ?callable $commitFunc = null, ?callable $rollbackFunc = null, |
65 | ?callable $savepointReleaseFunc = null, ?callable $savepointRollbackFunc = null): bool; |
66 | |
67 | } |