-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader #30962
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
Conversation
src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php
Outdated
Show resolved
Hide resolved
Can you add some information on what the goal of this PR is? |
@webmozart I've updated the description. |
@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). |
src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php
Outdated
Show resolved
Hide resolved
Thank you @HeahDude. |
…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
…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
…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
#EUFOSSA
Big thanks to @stof for the help with writing the test!
Description
It happens that the
IdReader
is created by theDoctrineType
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.