[PR #12210] [GH-12209] Prototype for loading partial objects fully #13581

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

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/12210
Author: @beberlei
Created: 10/8/2025
Status: 🔄 Open

Base: 3.7.xHead: GH-12209-PartialNativeLazy


📝 Commits (2)

  • 08e001a [GH-12209] Naive prototype for loading partial objects fully when accessing uninitialized field.
  • 62a53ec scope affected tests to only native lazy for better assertions.

📊 Changes

9 files changed (+99 additions, -18 deletions)

View changed files

📝 src/Internal/Hydration/ObjectHydrator.php (+1 -0)
📝 src/Internal/Hydration/SimpleObjectHydrator.php (+2 -0)
📝 src/Proxy/ProxyFactory.php (+5 -3)
📝 src/Query/ResultSetMapping.php (+17 -2)
📝 src/Query/SqlWalker.php (+5 -2)
📝 src/UnitOfWork.php (+10 -7)
📝 tests/Tests/ORM/Functional/QueryTest.php (+49 -0)
📝 tests/Tests/ORM/Functional/ValueObjectsTest.php (+6 -0)
📝 tests/Tests/ORM/Hydration/ObjectHydratorTest.php (+4 -4)

📄 Description

A partial object is actually just a proxy with more than just the ID field pre-populated. If we access a property of the partial object that is not already loaded, then we can trigger the proxy to load the missing fields.

Problems:

  • Embedded Objects need to be created as lazy ghosts as well that trigger lazy loading of the parent.
  • Changesets are overwritten by the proxy load.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/12210 **Author:** [@beberlei](https://github.com/beberlei) **Created:** 10/8/2025 **Status:** 🔄 Open **Base:** `3.7.x` ← **Head:** `GH-12209-PartialNativeLazy` --- ### 📝 Commits (2) - [`08e001a`](https://github.com/doctrine/orm/commit/08e001af8c333f448a3a90209135081e3d31cb83) [GH-12209] Naive prototype for loading partial objects fully when accessing uninitialized field. - [`62a53ec`](https://github.com/doctrine/orm/commit/62a53ecce038f537edd345a6841ffcb98c1b5999) scope affected tests to only native lazy for better assertions. ### 📊 Changes **9 files changed** (+99 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `src/Internal/Hydration/ObjectHydrator.php` (+1 -0) 📝 `src/Internal/Hydration/SimpleObjectHydrator.php` (+2 -0) 📝 `src/Proxy/ProxyFactory.php` (+5 -3) 📝 `src/Query/ResultSetMapping.php` (+17 -2) 📝 `src/Query/SqlWalker.php` (+5 -2) 📝 `src/UnitOfWork.php` (+10 -7) 📝 `tests/Tests/ORM/Functional/QueryTest.php` (+49 -0) 📝 `tests/Tests/ORM/Functional/ValueObjectsTest.php` (+6 -0) 📝 `tests/Tests/ORM/Hydration/ObjectHydratorTest.php` (+4 -4) </details> ### 📄 Description A partial object is actually just a proxy with more than just the ID field pre-populated. If we access a property of the partial object that is not already loaded, then we can trigger the proxy to load the missing fields. Problems: * Embedded Objects need to be created as lazy ghosts as well that trigger lazy loading of the parent. * Changesets are overwritten by the proxy load. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 16:17:38 +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#13581