Skip to content
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

[GH-8471] Undeprecate PARTIAL for objects in DQL #11653

Merged
merged 12 commits into from
Oct 12, 2024

Conversation

beberlei
Copy link
Member

With this PR SELECT PARTIAL p.{} is allowed again with object hydration. It was already re-allowed for array-hydration a few commits before.

The reason we want to allow this again is that PHP 8.4 Lazy Proxies will allow us to implement partial objects as proxies that will trigger lazy initialization as soon as one of the "not loaded" partial properties is accessed.

Related:

@beberlei beberlei marked this pull request as ready for review October 10, 2024 08:49
@Wirone
Copy link

Wirone commented Oct 10, 2024

Shouldn't it be "Revert deprecation of" or "Undeprecate" though?

@beberlei beberlei changed the title [GH-8471] Revert undeprecate PARTIAL for objects in DQL [GH-8471] Undeprecate PARTIAL for objects in DQL Oct 10, 2024
docs/en/reference/partial-objects.rst Outdated Show resolved Hide resolved
src/UnitOfWork.php Outdated Show resolved Hide resolved
@greg0ire greg0ire added this to the 3.3.0 milestone Oct 12, 2024
docs/en/reference/dql-doctrine-query-language.rst Outdated Show resolved Hide resolved
docs/en/reference/partial-objects.rst Outdated Show resolved Hide resolved
first access. This is possible in Java, for example, through
bytecode instrumentation. In PHP though this is not possible, so
there is no way to have "secure" partial objects in an ORM with
transparent persistence.
Copy link
Member

Choose a reason for hiding this comment

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

Is this sentence still true? Or should we say it's not implemented yet?

Copy link
Member Author

Choose a reason for hiding this comment

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

Its still true until we get lazy objects.

@greg0ire greg0ire merged commit 6995815 into doctrine:3.3.x Oct 12, 2024
85 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants