Adopt shared hydration pipeline from Data#100
Merged
Conversation
alganet
commented
Mar 19, 2026
Member
- Use Collection::resolveEntityName() in fetchSingle() instead of instanceof Typed check, removing the Typed import entirely
- Delegate Filtered persist to parent::persist() which now handles it in AbstractMapper
- Remove postHydrate(), tryHydration(), buildEntitiesInstances() — now inherited from AbstractMapper
- Remove dead $entities initialization in fetchMulti()
- Remove unused getSetterStyle() method and str_replace import
- Remove unnecessary $factory local variable aliases, access $this->entityFactory directly
- Fix extractAndOperateCompositions() to use key-based removal instead of value-based array_diff, with test for matching-value edge case
- Assert getColumnMeta() result instead of silently skipping
- Use Collection::resolveEntityName() in fetchSingle() instead of instanceof Typed check, removing the Typed import entirely - Delegate Filtered persist to parent::persist() which now handles it in AbstractMapper - Remove postHydrate(), tryHydration(), buildEntitiesInstances() — now inherited from AbstractMapper - Remove dead $entities initialization in fetchMulti() - Remove unused getSetterStyle() method and str_replace import - Remove unnecessary $factory local variable aliases, access $this->entityFactory directly - Fix extractAndOperateCompositions() to use key-based removal instead of value-based array_diff, with test for matching-value edge case - Assert getColumnMeta() result instead of silently skipping
There was a problem hiding this comment.
Pull request overview
This PR updates Respect\Relational\Mapper to adopt the shared hydration/persistence pipeline now provided by respect/data’s AbstractMapper, reducing local duplication while keeping Relational-specific query building and entity materialization.
Changes:
- Delegate Filtered persistence and hydration steps to
AbstractMapper(removing local hydration helpers and simplifyingpersist()/fetch flows). - Replace
Typed-specific logic infetchSingle()withCollection::resolveEntityName(), removing theTypeddependency/import. - Simplify entity factory usage by removing local aliases and using
$this->entityFactorydirectly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #100 +/- ##
============================================
- Coverage 99.37% 99.31% -0.07%
+ Complexity 180 165 -15
============================================
Files 3 3
Lines 478 436 -42
============================================
- Hits 475 433 -42
Misses 3 3 ☔ 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.