Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Merged
merged 1 commit into from
Apr 7, 2019

Conversation

HeahDude
Copy link
Contributor

@HeahDude HeahDude commented Apr 7, 2019

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
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.

@webmozart
Copy link
Contributor

Can you add some information on what the goal of this PR is?

@HeahDude
Copy link
Contributor Author

HeahDude commented Apr 7, 2019

@webmozart I've updated the description.

@stof
Copy link
Member

stof commented Apr 7, 2019

@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).
Anyone using the DoctrineType does not rely on this implicit optimization, as DoctrineType already does the check.

@xabbuh xabbuh added this to the next milestone Apr 7, 2019
@fabpot
Copy link
Member

fabpot commented Apr 7, 2019

Thank you @HeahDude.

@fabpot fabpot merged commit 287c39b into symfony:master Apr 7, 2019
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
@HeahDude HeahDude deleted the form/id-reader branch April 7, 2019 10:27
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
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019
@fabpot fabpot mentioned this pull request May 9, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants