PHPackages                             snapshotpl/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. snapshotpl/tactician-doctrine

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

snapshotpl/tactician-doctrine
=============================

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

1.2.0(4y ago)0663MITPHP &gt;=7.1

Since Feb 27Pushed 4y agoCompare

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

READMEChangelog (1)Dependencies (7)Versions (17)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 league/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

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 63.5% 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

Every ~209 days

Recently: every ~538 days

Total

13

Last Release

1583d ago

Major Versions

v0.6.0 → v1.0.02015-12-31

PHP version history (2 changes)v0.1PHP &gt;=5.5

1.2.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/93a2113828a101b473d256ef12e6bd89d67bcbef0621704cfeb3304c98a16a47?d=identicon)[snapshotpl](/maintainers/snapshotpl)

---

Top Contributors

[![rosstuck](https://avatars.githubusercontent.com/u/146766?v=4)](https://github.com/rosstuck "rosstuck (33 commits)")[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (8 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)")[![mateuszsip](https://avatars.githubusercontent.com/u/1377075?v=4)](https://github.com/mateuszsip "mateuszsip (1 commits)")[![cubanec](https://avatars.githubusercontent.com/u/5373336?v=4)](https://github.com/cubanec "cubanec (1 commits)")[![arnovr](https://avatars.githubusercontent.com/u/6443841?v=4)](https://github.com/arnovr "arnovr (1 commits)")[![sagikazarmark](https://avatars.githubusercontent.com/u/1226384?v=4)](https://github.com/sagikazarmark "sagikazarmark (1 commits)")

---

Tags

doctrinecommand bustacticiantransactions

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/snapshotpl-tactician-doctrine/health.svg)](https://phpackages.com/packages/snapshotpl-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)
