20 lines
409 B
PHP
20 lines
409 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Logic\Common;
|
|
|
|
interface TransactionManagerInterface
|
|
{
|
|
/**
|
|
* Führt den Closure innerhalb einer Datenbank-Transaktion aus.
|
|
* Bei Exception wird zurückgerollt, ansonsten committiert.
|
|
*
|
|
* @template T
|
|
* @param \Closure(): T $work
|
|
* @return T
|
|
* @throws \Throwable
|
|
*/
|
|
public function execute(\Closure $work): mixed;
|
|
}
|