Enable native lazy objects by default, add an option to disable it#940
Merged
GromNaN merged 5 commits intodoctrine:5.5.xfrom Oct 29, 2025
Merged
Enable native lazy objects by default, add an option to disable it#940GromNaN merged 5 commits intodoctrine:5.5.xfrom
GromNaN merged 5 commits intodoctrine:5.5.xfrom
Conversation
b2d1933 to
7d7d2e8
Compare
mickverm
reviewed
Oct 29, 2025
alcaeus
reviewed
Oct 29, 2025
| // Requires doctrine/mongodb-odm 2.10 | ||
| $container->getDefinition('doctrine_mongodb') | ||
| ->setArgument(5, $config['enable_lazy_ghost_objects'] ? Proxy::class : LazyLoadingInterface::class); | ||
| ->setArgument(5, $config['enable_lazy_ghost_objects'] ? LazyLoadingInterface::class : Proxy::class); |
Member
There was a problem hiding this comment.
Is this a bug in the previous implementation, or why does this need changing?
Member
Author
There was a problem hiding this comment.
It looks like a bug in the previous implementation. Not covered by a test.
Member
Author
There was a problem hiding this comment.
I was wrong. The LazyLoadingInterface is for ProxyManager.
alcaeus
approved these changes
Oct 29, 2025
Member
alcaeus
left a comment
There was a problem hiding this comment.
Minor wording change, but LGTM!
Co-authored-by: Andreas Braun <git@alcaeus.org>
This was referenced Oct 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use native lazy objects by default when
PHP >= 7.4anddoctrine/mongodb-odm >= 2.14(doctrine/mongodb-odm#2840)Add a new option
enable_native_lazy_objectsto disable this behavior.Todo
AbstractManagerRegistry::$proxyInterfaceNamenullable MakeAbstractManagerRegistry::$proxyInterfaceNamenullable persistence#458