[GH-8327] Deprecate EntityManagerHelper for a provider abstraction.#8524
[GH-8327] Deprecate EntityManagerHelper for a provider abstraction.#8524beberlei merged 18 commits intodoctrine:2.9.xfrom
Conversation
… instead of HelperSet.
… instead of HelperSet.
… instead of HelperSet.
| public function getManager(string $name = 'default'): EntityManagerInterface | ||
| { | ||
| if ($name !== 'default') { | ||
| throw UnknownManagerException::unknownManager($name, ['default']); |
There was a problem hiding this comment.
Is it possible that people define several managers but end up using SingleManagerProvider? If yes, that exception will be confusing I think.
There was a problem hiding this comment.
No the SingleManagerProvider is for non Symfony context, where usually you have only one and you don't care about any of this. :)
Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
…ency with DoctrineBundle.
greg0ire
left a comment
There was a problem hiding this comment.
LGTM. The code suggestions I added are just that: suggestions
lib/Doctrine/ORM/Tools/Console/Command/AbstractEntityManagerCommand.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/ORM/Tools/Console/EntityManagerProvider/ConnectionFromManagerProvider.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/ORM/Tools/Console/EntityManagerProvider/HelperSetManagerProvider.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/ORM/Tools/Console/EntityManagerProvider/SingleManagerProvider.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/ORM/Tools/Console/EntityManagerProvider/UnknownManagerException.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
|
@beberlei adding |
|
@dominikzogg we speifically added code to prevent breaking in doctrine Bundle |
|
@beberlei as mentioned: there is code outside the symfony ecosystem out there https://github.com/chubbyphp/chubbyphp-laminas-config-doctrine/pull/3/files and i am not even done yet => will lead to a major release on my side and when orm 3.0 gets released another major cause i am sure there will be (expected) bc's |
|
Adding any parameter could have caused this, others might use |
do it in 3.0, so nobody get forced to update code immediately |
|
That ship has sailed :) |
Deprecates the
EntityManagerHelperin favor of a newEntityManagerProviderinterface that comes with two implementation.HelpersetManagerProviderSingleManagerProviderthat provides access to a single entity manager.In addition an implementation for the DBAL
ConnectionProvideris provided that is based on anyEntityManagerProviderand callinggetConnection()on the EntityManager.It is expected for the DoctrineBundle to create a new
EntityManagerProviderthat provides access to their multiple ORM entity managers via the Symfony DI Container.Two deprecation messages are added:
HelperSetManagerProvidermust be used from withinConsoleRunner, because aHelperSetis passed.EntityManagerProvideras a dependency.Todos:
Fixes #8327