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 | /* |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2023 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\generis\persistence\Graph; |
| 23 | |
| 24 | use Laudis\Neo4j\Databags\Statement; |
| 25 | use Laudis\Neo4j\Databags\SummarizedResult; |
| 26 | |
| 27 | interface TransactionManagerInterface |
| 28 | { |
| 29 | /** |
| 30 | * @return void |
| 31 | * |
| 32 | * @throws GraphTransactionException when starting transaction failed. |
| 33 | */ |
| 34 | public function beginTransaction(): void; |
| 35 | |
| 36 | /** |
| 37 | * @return void |
| 38 | * |
| 39 | * @throws GraphTransactionException when transaction commit failed. |
| 40 | */ |
| 41 | public function commit(): void; |
| 42 | |
| 43 | /** |
| 44 | * @return void |
| 45 | * |
| 46 | * @throws GraphTransactionException when transaction was not rolled back. |
| 47 | */ |
| 48 | public function rollback(): void; |
| 49 | |
| 50 | /** |
| 51 | * @param string $statement |
| 52 | * @param iterable $parameters |
| 53 | * |
| 54 | * @return SummarizedResult |
| 55 | * |
| 56 | * @throws GraphTransactionException |
| 57 | */ |
| 58 | public function run(string $statement, iterable $parameters = []): SummarizedResult; |
| 59 | |
| 60 | /** |
| 61 | * @param Statement $statement |
| 62 | * |
| 63 | * @return SummarizedResult |
| 64 | * |
| 65 | * @throws GraphTransactionException |
| 66 | */ |
| 67 | public function runStatement(Statement $statement): SummarizedResult; |
| 68 | } |