[PR #9961] Deprecate EntityManager::create() #12005

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

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

State: closed
Merged: Yes


Now that the entity manager's constructor is public, why not make it the only way to construct an EM?

The only additional feature that create() has is that you can pass the connection parameters instead of a real DBAL connection. However, I believe that bootstrapping the DBAL connection is a concern that belongs into the DBAL library and the DBAL's DriverManager class already does a fine job in that regard.

This is why I believe that we shouldn't need the create() method anymore.

**Original Pull Request:** https://github.com/doctrine/orm/pull/9961 **State:** closed **Merged:** Yes --- Now that the entity manager's constructor is public, why not make it the only way to construct an EM? The only additional feature that `create()` has is that you can pass the connection parameters instead of a real DBAL connection. However, I believe that bootstrapping the DBAL connection is a concern that belongs into the DBAL library and the DBAL's `DriverManager` class already does a fine job in that regard. This is why I believe that we shouldn't need the `create()` method anymore.
admin added the pull-request label 2026-01-22 16:12:36 +01:00
admin closed this issue 2026-01-22 16:12:37 +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#12005