Download the PHP package wws-aslan/tactician-doctrine without Composer
On this page you can find all versions of the php package wws-aslan/tactician-doctrine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wws-aslan/tactician-doctrine
More information about wws-aslan/tactician-doctrine
Files in wws-aslan/tactician-doctrine
Package tactician-doctrine
Short Description Plugins for Tactician commands using Doctrine, like wrapping every command in a transaction
License MIT
Homepage https://github.com/thephpleague/tactician-doctrine
Informations about the package tactician-doctrine
tactician-doctrine
This package adds plugins for using Tactician with Doctrine components, either the ORM or just DBAL. The main feature is the ability to wrap each command in a separate database transaction.
Setup
Via Composer
Next, add the ORM\TransactionMiddleware
to your CommandBus:
That's it. Each command you execute will now open and close a new transaction.
If a command fires off more commands, be aware that those commands will run in the same transaction as the parent. It is recommended that you run each command as a separate transaction, so to prevent this from happening, use the LockingMiddleware
that ships in Tactician core. This will queue the commands up internally until the parent command has completed.
If an exception is raised while handling the command, the transaction is rolled back, the EntityManager closed, and the exception rethrown.
Symfony integration
When using the [tactician-bundle] (https://github.com/thephpleague/tactician-bundle), don't forget to add the Doctrine middleware to your Symfony config:
Testing
Security
Disclosure information can be found on the main Tactician repo.
License
The MIT License (MIT). Please see License File for more information.