-
-
Notifications
You must be signed in to change notification settings - Fork 920
Trigger eager loading when using the attributes serializer option #1546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,7 +137,17 @@ private function joinRelations(QueryBuilder $queryBuilder, QueryNameGeneratorInt | |
continue; | ||
} | ||
|
||
if ((false === $propertyMetadata->isReadableLink() || false === $propertyMetadata->isReadable()) && false === $propertyMetadata->getAttribute('fetchEager', false)) { | ||
if ($inAttributes = isset($context[AbstractNormalizer::ATTRIBUTES][$association])) { | ||
// prepare the child context | ||
$context[AbstractNormalizer::ATTRIBUTES] = $context[AbstractNormalizer::ATTRIBUTES][$association]; | ||
} else { | ||
unset($context[AbstractNormalizer::ATTRIBUTES]); | ||
} | ||
|
||
if ( | ||
((!$inAttributes && false === $propertyMetadata->isReadableLink()) || false === $propertyMetadata->isReadable()) && | ||
false === $propertyMetadata->getAttribute('fetchEager', false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Did you start you PR on master? I can't recognize the replaced code which may have lead to weird copy/paste? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can I let you handle that? I've changed this part (only the CS) and I'm not really comfortable with it. |
||
) { | ||
continue; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cs is strange here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?