Repository navigation
Conversation
With an output class, or a resource mapped to an entity through stateOptions, the ORM eager loading extension walks the properties of the serialized shape instead of the entity: embedded relations are joined without serialization groups, renamed associations are followed through #[Map], and a relation read by a transform stays unjoined. Refs #8849, fixes #8765 Co-authored-by: Philippe Pichet <phil@pichet.eu>
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.
Part 6/6 of the RFC #8849 stack (https://github.com/api-platform/core/stack/8945), review commit by commit: the first commit is the failing test.
With an output class, or a resource mapped to an entity through
stateOptions, the ORM eager loading extension walks the properties of the serialized shape instead of the entity: embedded relations are joined without serialization groups, renamed associations are followed through#[Map], a relation read by atransform(other thanMapCollection) stays unjoined. One walker, the legacy path is unchanged.Tests ported from #8836 (thanks @philpichet, co-author):
tests/Functional/Doctrine/StateOptionsEagerLoadingTest.php(10→2, 9→2, 16→3 queries) plus an output-driven case.BC: such resources get joins they did not get before,
max_joinsmay be reached sooner.