PHPackages                             villermen/doctrine-identity-queuer - 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. villermen/doctrine-identity-queuer

ActiveLibrary

villermen/doctrine-identity-queuer
==================================

v1.1.0(1mo ago)2587MITPHPPHP &gt;=8.4CI passing

Since Mar 4Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/villermen/doctrine-identity-queuer)[ Packagist](https://packagist.org/packages/villermen/doctrine-identity-queuer)[ RSS](/packages/villermen-doctrine-identity-queuer/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (7)Versions (5)Used By (0)

doctrine-identity-queuer
========================

[](#doctrine-identity-queuer)

#### Queue IDs for your next inserted entities.

[](#queue-ids-for-your-next-inserted-entities)

[![Test](https://github.com/villermen/doctrine-identity-queuer/actions/workflows/test.yml/badge.svg)](https://github.com/villermen/doctrine-identity-queuer/actions/workflows/test.yml)

Description
-----------

[](#description)

This package adds an `IdentityQueuer` class, that allows you to set identities (IDs) of Doctrine entities in advance. It is able to do this for entities that are configured to have a different identity generation strategy.

This package's main use-case is to explicitly set IDs of entities that are created somewhere in your services during unit tests. It is not advised to use this package in production, as there are better ways of achieving custom ID generation outside of testing.

Usage
-----

[](#usage)

```
use Villermen\DoctrineIdentityQueuer\IdentityQueuer;

$identityQueuer = new IdentityQueuer($entityManager);
$identityQueuer->queueIdentity(User::class, 1234);

$user = new User()

$entityManager->persist($user);
$entityManager->flush();

// $user should have been given an id of 1234 instead of an automatically generated one!
```

Installing
----------

[](#installing)

`composer require --dev villermen/doctrine-identity-queuer`

How does it work?
-----------------

[](#how-does-it-work)

`IdentityQueuer` will override the ID generator for entities when there are queued identities waiting for them. It subscribes to Doctrine's `preFlush` event to flush the entities with queued identies first, before performing the actual flush. Before performing the actual flush, the generators are changed back so that additional entities will behave like they originally would.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance90

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% 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 ~1470 days

Total

3

Last Release

51d ago

PHP version history (2 changes)v1.0.1PHP &gt;=7.1

v1.1.0PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/212c27b557d8126e053ac3ed5491944ec8bccd1b8bb910e807934786233f3020?d=identicon)[Villermen](/maintainers/Villermen)

---

Top Contributors

[![villermen](https://avatars.githubusercontent.com/u/1106303?v=4)](https://github.com/villermen "villermen (17 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/villermen-doctrine-identity-queuer/health.svg)

```
[![Health](https://phpackages.com/badges/villermen-doctrine-identity-queuer/health.svg)](https://phpackages.com/packages/villermen-doctrine-identity-queuer)
```

###  Alternatives

[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[api-platform/doctrine-orm

Doctrine ORM bridge

243.1M39](/packages/api-platform-doctrine-orm)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[pixelfederation/doctrine-resettable-em-bundle

Symfony bundle for decorating default entity managers using a resettable decorator.

20113.5k](/packages/pixelfederation-doctrine-resettable-em-bundle)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

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