Skip to content

Replace deprecated ObjectManager #13131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2020

Conversation

tvlooy
Copy link
Contributor

@tvlooy tvlooy commented Feb 14, 2020

Doctrine\Common\Persistence\ObjectManager is deprecated and should be replaced with Doctrine\Persistence\ManagerRegistry this is supported in symfony/doctrine-bridge now symfony/doctrine-bridge@c94d84f

@javiereguiluz
Copy link
Member

@tvlooy thanks for improving the docs!

@xabbuh @wouterj do you see any problem for merging this in 3.4? Thanks!

@javiereguiluz javiereguiluz added this to the 3.4 milestone Feb 14, 2020
Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not completely understand the changes. Aren't the namespace changes about removing the Common part?

So Doctrine\Common\Persistence\ObjectManager should become Doctrine\Persistence\ObjectManager. ManagerRegistry is a registry holding all ObjectManager's, so it's not a one to one replacement for ObjectManager.

This is also what the deprecation messages suggests: https://github.com/doctrine/persistence/pull/71/files#diff-0e209770d31833077cce41eba53a171eR11-R17

@tvlooy
Copy link
Contributor Author

tvlooy commented Feb 15, 2020

I do not completely understand the changes. Aren't the namespace changes about removing the Common part?

So Doctrine\Common\Persistence\ObjectManager should become Doctrine\Persistence\ObjectManager. ManagerRegistry is a registry holding all ObjectManager's, so it's not a one to one replacement for ObjectManager.

This is also what the deprecation messages suggests: https://github.com/doctrine/persistence/pull/71/files#diff-0e209770d31833077cce41eba53a171eR11-R17

Whoops. Fixed!

Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thanks for your quick reaction.

I agree with merging this into 3.4, as symfony/symfony#34949 was targetted at 3.4 as well (and there is also already a 3.4 release containing this patch).

@HeahDude HeahDude force-pushed the deprecated_doctrine_objectmanager branch from 7743d52 to a10dab6 Compare February 16, 2020 23:16
@HeahDude
Copy link
Contributor

Thank you @tvlooy.

HeahDude added a commit that referenced this pull request Feb 16, 2020
This PR was squashed before being merged into the 3.4 branch (closes #13131).

Discussion
----------

Replace deprecated ObjectManager

```Doctrine\Common\Persistence\ObjectManager``` is deprecated and should be replaced with ```Doctrine\Persistence\ManagerRegistry``` this is supported in symfony/doctrine-bridge now symfony/doctrine-bridge@c94d84f

Commits
-------

a10dab6 Replace deprecated ObjectManager
@HeahDude HeahDude merged commit a10dab6 into symfony:3.4 Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants