PHPackages                             wws-aslan/tactician-doctrine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. wws-aslan/tactician-doctrine

ActiveLibrary[Database &amp; ORM](/categories/database)

wws-aslan/tactician-doctrine
============================

Plugins for Tactician commands using Doctrine, like wrapping every command in a transaction

v1.1.0(2y ago)010MITPHPPHP &gt;=7.4

Since May 10Pushed 2y agoCompare

[ Source](https://github.com/wws-aslan/tactician-doctrine)[ Packagist](https://packagist.org/packages/wws-aslan/tactician-doctrine)[ Docs](https://github.com/thephpleague/tactician-doctrine)[ RSS](/packages/wws-aslan-tactician-doctrine/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

tactician-doctrine
==================

[](#tactician-doctrine)

[![Latest Version](https://camo.githubusercontent.com/7ccfe021caf7d4ebe094e3059856323750f3e0fb3a2c86591e28c469444aae05/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7468657068706c65616775652f74616374696369616e2d646f637472696e652e7376673f7374796c653d666c61742d737175617265)](https://github.com/thephpleague/tactician-doctrine/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/1631fd5ff6913567e8f3edb0d3d86447f5e530a39734067b5546649a0a07c327/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7468657068706c65616775652f74616374696369616e2d646f637472696e652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/thephpleague/tactician-doctrine)[![Quality Score](https://camo.githubusercontent.com/994f5e0ef1dbd67560fee2315eff27f5340623417f9ce77b17f406940107889b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7468657068706c65616775652f74616374696369616e2d646f637472696e652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/tactician-doctrine)[![Total Downloads](https://camo.githubusercontent.com/3c35be982f2567f581d467e2a4c31649b7c25d0a4b7b69bcdfe0b3cf3dec3d46/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65616775652f74616374696369616e2d646f637472696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/league/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
-----

[](#setup)

Via Composer

```
$ composer require wws-aslan/tactician-doctrine
```

Next, add the `ORM\TransactionMiddleware` to your CommandBus:

```
$commandBus = new \League\Tactician\CommandBus(
    [
        new TransactionMiddleware($ormEntityManager)
    ]
);
```

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](http://tactician.thephpleague.com/plugins/locking-middleware/). 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
-------------------

[](#symfony-integration)

When using the \[tactician-bundle\] (), don't forget to add the Doctrine middleware to your Symfony config:

```
tactician:
    commandbus:
        default:
            middleware:
             - tactician.middleware.locking
             - tactician.middleware.doctrine
             - tactician.middleware.command_handler

```

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit
```

Security
--------

[](#security)

Disclosure information can be found on [the main Tactician repo](https://github.com/thephpleague/tactician#security).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

732d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc4872188025518fd822f3bf99fab4e079902686030758146ca00c231d89dfd4?d=identicon)[emil@aslaninteractive.com](/maintainers/emil@aslaninteractive.com)

---

Top Contributors

[![rosstuck](https://avatars.githubusercontent.com/u/146766?v=4)](https://github.com/rosstuck "rosstuck (41 commits)")[![boekkooi](https://avatars.githubusercontent.com/u/399895?v=4)](https://github.com/boekkooi "boekkooi (4 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (3 commits)")[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (2 commits)")[![monteiro](https://avatars.githubusercontent.com/u/74459?v=4)](https://github.com/monteiro "monteiro (2 commits)")[![arnovr](https://avatars.githubusercontent.com/u/6443841?v=4)](https://github.com/arnovr "arnovr (1 commits)")[![wws-aslan](https://avatars.githubusercontent.com/u/12764573?v=4)](https://github.com/wws-aslan "wws-aslan (1 commits)")[![cubanec](https://avatars.githubusercontent.com/u/5373336?v=4)](https://github.com/cubanec "cubanec (1 commits)")[![mateuszsip](https://avatars.githubusercontent.com/u/1377075?v=4)](https://github.com/mateuszsip "mateuszsip (1 commits)")[![sagikazarmark](https://avatars.githubusercontent.com/u/1226384?v=4)](https://github.com/sagikazarmark "sagikazarmark (1 commits)")[![simPod](https://avatars.githubusercontent.com/u/327717?v=4)](https://github.com/simPod "simPod (1 commits)")

---

Tags

doctrinecommand bustacticiantransactions

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wws-aslan-tactician-doctrine/health.svg)

```
[![Health](https://phpackages.com/badges/wws-aslan-tactician-doctrine/health.svg)](https://phpackages.com/packages/wws-aslan-tactician-doctrine)
```

###  Alternatives

[league/tactician-doctrine

Plugins for Tactician commands using Doctrine, like wrapping every command in a transaction

583.1M9](/packages/league-tactician-doctrine)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M36](/packages/scienta-doctrine-json-functions)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[simple-bus/symfony-bridge

Bridge for using command buses and event buses in Symfony projects

1314.3M19](/packages/simple-bus-symfony-bridge)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
