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

Reintroduce PARTIAL, but only for non-object hydration. #11365

Open
wants to merge 5 commits into
base: 3.2.x
Choose a base branch
from

Conversation

beberlei
Copy link
Member

@beberlei beberlei commented Mar 16, 2024

As discussed in #8471 (comment), PARTIAL is re-introduced in 3.2 but only when used with non object hydrators, usefully with array hydration.

This will allow retrieval of partial fields with complex entity dql relationships, example:

    $query = $em->createQuery('SELECT partial u.{id, username}, partial a.{id, name} FROM CmsUser u JOIN u.articles a');
    $users = $query->getArrayResult(); // array of partially loaded CmsUser and CmsArticle fields

Todo:

  • Test for the partial hydration exception with object hydration mode
  • Test for UnitOfWork::createEntity with partial keyword usage.
  • Actual test for array hydrator partial usage

Related:

@beberlei beberlei marked this pull request as ready for review March 16, 2024 21:40
Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
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.

None yet

2 participants