ideo/transaction

数据库事务库。

1.1 2018-04-12 18:51 UTC

This package is not auto-updated.

Last update: 2024-09-21 08:32:21 UTC


README

Build Status

我们将为每个框架分享不同的事务实现。

在实现数据库访问的仓库模式时,框架特定的类可能在服务层事务实现中暴露,但我们会避免这种情况。

相应的框架如下。

  • PDO
  • Doctrine DBAL
  • Doctrine ORM
  • Laravel
  • Lumen

使用方法

// class corresponding to each framework
$tm = new ... 

$tm->beginTransaction();

...

$tm->commit();

// class corresponding to each framework
$tm = new ... 

$tm->transactional(function () {
    ...
});