diff --git a/Db.php b/Db.php index 9e62bbd..12de300 100644 --- a/Db.php +++ b/Db.php @@ -9,6 +9,7 @@ declare(strict_types=1); namespace Database; +use Database\Affair\BeginTransaction; use Database\Affair\Commit; use Database\Affair\Rollback; use Database\Traits\QueryTrait; @@ -41,10 +42,16 @@ class Db implements ISqlBuilder } /** + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + * @throws ReflectionException */ public static function beginTransaction() { Context::setContext('transactions::status', true); + + $event = \Kiri::getDi()->get(EventDispatch::class); + $event->dispatch(new BeginTransaction()); }