[PR #11365] Reintroduce PARTIAL, but only for non-object hydration. #12975

Open
opened 2026-01-22 16:15:46 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/11365

State: closed
Merged: Yes


As discussed in https://github.com/doctrine/orm/issues/8471#issuecomment-2002116608, 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:

**Original Pull Request:** https://github.com/doctrine/orm/pull/11365 **State:** closed **Merged:** Yes --- As discussed in https://github.com/doctrine/orm/issues/8471#issuecomment-2002116608, `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: ```php $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: * [x] Test for the partial hydration exception with object hydration mode * [x] Test for UnitOfWork::createEntity with partial keyword usage. * [x] Actual test for array hydrator partial usage Related: * #11366 * #8471
admin added the pull-request label 2026-01-22 16:15:46 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#12975