Fix embedded entities loading via BulkLoader#565
Merged
Conversation
8d7e72c to
4d45831
Compare
There was a problem hiding this comment.
Pull request overview
Adds end-to-end coverage and runtime support for lazy-loaded embedded (same-row) relations when using BulkLoader, ensuring embedded entities can be batch-hydrated without per-entity follow-up queries.
Changes:
- Implement embedded-relation handling in
Relation\BulkLoaderby warming the heap via a batchedSelectand then resolving embedded references. - Add new cross-driver integration test case Case565 (schema, entities, and assertions) covering
Select::load(), promise resolution, andBulkLoader::load(). - Tighten PHPDoc types for relation maps / inner keys to improve static analysis.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ORM/Functional/Driver/SQLServer/Integration/Case565/CaseTest.php | SQLServer wrapper to run the shared Case565 integration suite. |
| tests/ORM/Functional/Driver/SQLite/Integration/Case565/CaseTest.php | SQLite wrapper to run the shared Case565 integration suite. |
| tests/ORM/Functional/Driver/Postgres/Integration/Case565/CaseTest.php | Postgres wrapper to run the shared Case565 integration suite. |
| tests/ORM/Functional/Driver/MySQL/Integration/Case565/CaseTest.php | MySQL wrapper to run the shared Case565 integration suite. |
| tests/ORM/Functional/Driver/Common/Integration/Case565/schema.php | Schema defining embedded relations and supporting entities for Case565. |
| tests/ORM/Functional/Driver/Common/Integration/Case565/Entity/UserProfile.php | Embedded entity used by the user.profile relation. |
| tests/ORM/Functional/Driver/Common/Integration/Case565/Entity/UserCredentials.php | Embedded entity used by the user.credentials relation. |
| tests/ORM/Functional/Driver/Common/Integration/Case565/Entity/User.php | Root entity with embedded relations and a has-many relation for mixed loading scenarios. |
| tests/ORM/Functional/Driver/Common/Integration/Case565/Entity/OrderShipping.php | Embedded entity used by the order.shipping relation (composite PK coverage). |
| tests/ORM/Functional/Driver/Common/Integration/Case565/Entity/Order.php | Root entity with composite PK and embedded relation for BulkLoader coverage. |
| tests/ORM/Functional/Driver/Common/Integration/Case565/Entity/Comment.php | Related entity for has-many loading alongside embedded relations. |
| tests/ORM/Functional/Driver/Common/Integration/Case565/CaseTest.php | Shared integration assertions validating embedded loading via Select, promise resolution, and BulkLoader (incl. query-count expectations). |
| src/RelationMap.php | PHPDoc type refinements for relation map collections and getRelations(). |
| src/Relation/RelationInterface.php | Adds PHPDoc for getInnerKeys() return shape. |
| src/Relation/BulkLoader.php | Implements batched embedded loading via Select, tracks embedded relations, and resolves embedded references during hydration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #565 +/- ##
============================================
+ Coverage 91.55% 91.59% +0.03%
- Complexity 2003 2013 +10
============================================
Files 131 131
Lines 5200 5223 +23
============================================
+ Hits 4761 4784 +23
Misses 439 439 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
🔍 What was changed
📝 Checklist
📃 Documentation