[DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader#30962
Merged
fabpot merged 1 commit intosymfony:masterfrom Apr 7, 2019
Merged
[DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader#30962fabpot merged 1 commit intosymfony:masterfrom
fabpot merged 1 commit intosymfony:masterfrom
Conversation
fabpot
requested changes
Apr 7, 2019
src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php
Outdated
Show resolved
Hide resolved
Contributor
|
Can you add some information on what the goal of this PR is? |
Contributor
Author
|
@webmozart I've updated the description. |
Member
|
@webmozart simplifying the DoctrineChoiceLoader in a follow-up PR refactoring the caching of choice loaders (which is currently broken for most cases except the doctrine one). |
stof
approved these changes
Apr 7, 2019
xabbuh
requested changes
Apr 7, 2019
src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php
Outdated
Show resolved
Hide resolved
xabbuh
approved these changes
Apr 7, 2019
fabpot
approved these changes
Apr 7, 2019
Member
|
Thank you @HeahDude. |
fabpot
added a commit
that referenced
this pull request
Apr 7, 2019
…octrineChoiceLoader (HeahDude) This PR was merged into the 4.3-dev branch. Discussion ---------- [DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | ~ | License | MIT | Doc PR | ~ #EUFOSSA Big thanks to @stof for the help with writing the test! ## Description It happens that the `IdReader` is created by the `DoctrineType` and cached for each entity class case. But the type already resolves whether or not it should use it, only when we can optimize query thanks to a single id field when defining the `choice_value` option: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php#L188. This PR is a first step to optimize the choice loading process. Commits ------- 287c39b [DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader
stof
added a commit
that referenced
this pull request
Apr 7, 2019
…tion is not possible (HeahDude) This PR was merged into the 4.3-dev branch. Discussion ---------- [DoctrineBridge] Deprecated using IdReader when optimization is not possible | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | ~ | License | MIT | Doc PR | ~ Follow up of #30962. (Review only the second commit until #30962 is merged). Commits ------- a234c89 [DoctrineBridge] Deprecated using IdReader when optimization is not possible
Merged
nicolas-grekas
added a commit
that referenced
this pull request
Jun 6, 2019
…ChoiceLoader (yceruto) This PR was merged into the 5.0-dev branch. Discussion ---------- [DoctrineBridge] Removed legacy code related to DoctrineChoiceLoader | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Ref: #30966 and #30962 Commits ------- 4616e54 Removed legacy code related to DoctrineChoiceLoader
1 task
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.
#EUFOSSA
Big thanks to @stof for the help with writing the test!
Description
It happens that the
IdReaderis created by theDoctrineTypeand cached for each entity class case.But the type already resolves whether or not it should use it, only when we can optimize query thanks to a single id field when defining the
choice_valueoption: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php#L188.This PR is a first step to optimize the choice loading process.