[PR #6408] ID generators require concrete EntityManager instance instead of EntityManagerInterface #9973

Closed
opened 2026-01-22 16:06:02 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/6408

State: closed
Merged: No


I came across this issue while attempting to implement an EntityManager Decorator to handle resetting the UoW and EntityManager. After doing so, I began receiving errors like

Argument 1 passed to Doctrine\ORM\Id\IdentityGenerator::generate() must be an instance of Doctrine\ORM\EntityManager, instance of MyEntityManager given ...

Where MyEntityManager implements Doctrine\ORM\EntityManagerInterface

Files touched

  1. lib/Doctrine/ORM/Id/AbstractIdGenerator.php
  2. lib/Doctrine/ORM/Id/AssignedGenerator.php
  3. lib/Doctrine/ORM/Id/BigIntegerIdentityGenerator.php
  4. lib/Doctrine/ORM/Id/IdentityGenerator.php
  5. lib/Doctrine/ORM/Id/SequenceGenerator.php
  6. lib/Doctrine/ORM/Id/TableGenerator.php
  7. lib/Doctrine/ORM/Id/UuidGenerator.php
  8. tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2415Test.php :: class DDC2415Generator
  9. tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php :: class CustomIdGenerator
  10. tests/Doctrine/Tests/OrmFunctionalTestCase.php
**Original Pull Request:** https://github.com/doctrine/orm/pull/6408 **State:** closed **Merged:** No --- I came across this issue while attempting to implement an EntityManager Decorator to handle resetting the UoW and EntityManager. After doing so, I began receiving errors like ``` Argument 1 passed to Doctrine\ORM\Id\IdentityGenerator::generate() must be an instance of Doctrine\ORM\EntityManager, instance of MyEntityManager given ... ``` Where `MyEntityManager` implements `Doctrine\ORM\EntityManagerInterface` ## Files touched 1. lib/Doctrine/ORM/Id/AbstractIdGenerator.php 2. lib/Doctrine/ORM/Id/AssignedGenerator.php 3. lib/Doctrine/ORM/Id/BigIntegerIdentityGenerator.php 4. lib/Doctrine/ORM/Id/IdentityGenerator.php 5. lib/Doctrine/ORM/Id/SequenceGenerator.php 6. lib/Doctrine/ORM/Id/TableGenerator.php 7. lib/Doctrine/ORM/Id/UuidGenerator.php 8. tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2415Test.php :: `class DDC2415Generator` 9. tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php :: `class CustomIdGenerator` 10. tests/Doctrine/Tests/OrmFunctionalTestCase.php
admin added the pull-request label 2026-01-22 16:06:02 +01:00
admin closed this issue 2026-01-22 16:06:02 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9973