ideo / transaction
数据库事务库。
1.1
2018-04-12 18:51 UTC
Requires
- php: ^5.4|^7.0
Requires (Dev)
- ext-pdo: *
- ext-sqlite3: *
- doctrine/dbal: ^2.5
- doctrine/orm: ^2.5
- illuminate/container: ^5.0
- illuminate/database: ^5.0
- phpunit/phpunit: ^4.8|^5.7
Suggests
- ext-pdo: Using PDO.
- doctrine/dbal: Using dbal (~2.5).
- doctrine/orm: Using doctrine orm (~2.5).
- illuminate/database: Using laravel (~5.0).
This package is not auto-updated.
Last update: 2024-09-21 08:32:21 UTC
README
我们将为每个框架分享不同的事务实现。
在实现数据库访问的仓库模式时,框架特定的类可能在服务层事务实现中暴露,但我们会避免这种情况。
相应的框架如下。
- 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 () {
...
});