Hotfix/filter eager loading fetch eager#1028
Conversation
25159c7 to
5a52bf6
Compare
| private function toDQLString(string $dql): string | ||
| { | ||
| return preg_replace('/\\r\\n|\\n/', '', str_replace(' ', '', $dql)); | ||
| return preg_replace(['/\s+/', '/\(\s/', '/\s\)/'], [' ', '(', ')'], $dql); |
There was a problem hiding this comment.
Actually this is unsafe... It might change whitespace within a SQL literal (string). Lol...
There was a problem hiding this comment.
Of course, as said before it makes tests more readable :).
5a52bf6 to
84f5d7f
Compare
| return is_bool($forceEager) ? $forceEager : $this->forceEager; | ||
| } | ||
|
|
||
| private function hasFetchEagerAssociation(EntityManager $em, ClassMetadataInfo $classMetadata, &$checked = []) |
There was a problem hiding this comment.
Is it possible to extract this logic out for reuse between EagerLoadingExtension and FilterEagerLoadingExtension?
There was a problem hiding this comment.
I don't want to to this to avoid a 2-pass recursive call in EagerLoadingExtension. If we want to extract this logic we need to add cache. I obviously agree that we should add a new class with the shouldEagerLoad logic.
There was a problem hiding this comment.
Can't this be extracted in another PR?
There was a problem hiding this comment.
Yeah it can and should, +1 to do this in another PR as it's not a priority.
84f5d7f to
abba678
Compare
|
Feel free to merge I have a note that I should refactor the |
|
Thank you @soyuka |
* Removed unneeded catch on ResourceClassNotFound * fix FilterEagerLoading when entity has FETCH_EAGER with no force eager
ping @teohhanhui