Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[DoctrineBridge] update doctrine event listeners doc for Symfony 4.2 change#9973
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ServiceLocator (dmaicher)This PR was squashed before being merged into the 4.2-dev branch (closes #27675).Discussion----------[DoctrineBridge] always load event listeners lazy via ServiceLocator| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | yes/no| Tests pass? | yes| Fixed tickets |symfony/symfony#27661| License | MIT| Doc PR |symfony/symfony-docs#9973As described insymfony/symfony#27661 this PR suggests to always load doctrine event listeners lazily from a service locator instead of the full service container.If we agree to move forward I could tackle the remaining todos:- [x] update UPGRADE.md- [x] documentation PR- [x] tested on real appCommits-------130ec0525d [DoctrineBridge] always load event listeners lazy via ServiceLocator
…ServiceLocator (dmaicher)This PR was squashed before being merged into the 4.2-dev branch (closes#27675).Discussion----------[DoctrineBridge] always load event listeners lazy via ServiceLocator| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | yes/no| Tests pass? | yes| Fixed tickets |#27661| License | MIT| Doc PR |symfony/symfony-docs#9973As described in#27661 this PR suggests to always load doctrine event listeners lazily from a service locator instead of the full service container.If we agree to move forward I could tackle the remaining todos:- [x] update UPGRADE.md- [x] documentation PR- [x] tested on real appCommits-------130ec05 [DoctrineBridge] always load event listeners lazy via ServiceLocator
HeahDude left a comment
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.
Thank you very much for your work on this.
| .. _`The Event System`:http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html | ||
| .. _`the Doctrine Documentation`:http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html#entity-listeners | ||
| So whenever possible it is preferable to use entity listeners instead of subscribers. |
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.
Hmm we might need another PR in core before merging such thing x).
| whenever possible. | ||
| ..versionadded::4.2 | ||
| The default lazy behavior of Doctrine entity listeners was introduced in |
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.
technically this is not correct. It was possible even before Symfony 4.2 but you had to manually add a 😊lazy=true attribute for the tag. Now since 4.2 it will be always lazy
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.
Ah sorry I missed the "default" while reading it. All good 👍
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.
In that phrase I tried to say: "in 4.2 the new thing is that is lazy by default". But it looks like I failed.
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.
@dmaicher in 4.2 they are lazy by default ... or are they mandatory lazy? In other words, can you saylazy:false in 4.2?
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.
No they are always lazy now. So mandatory.
| ..versionadded::4.2 | ||
| Starting from Symfony 4.2, Doctrine entity listeners are lazy by default. | ||
| Starting from Symfony 4.2, Doctrine entity listeners are always lazy. In |
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.
I think now its more clear 👍 Thanks 😄
javiereguiluz commentedJun 29, 2018
Thanks David. |
…Symfony 4.2 change (dmaicher, javiereguiluz)This PR was merged into the master branch.Discussion----------[DoctrineBridge] update doctrine event listeners doc for Symfony 4.2 changeSeesymfony/symfony#27675.Doctrine entity listeners are always lazily instantiated as of Symfony 4.2.Commits-------4409fd6 Explain that lazy listeners are mandatory, not defaultb56ef9e Update event_listeners_subscribers.rstd8bb849 Reworded and added the versionadded directive601450e Update event_listeners_subscribers.rst
Seesymfony/symfony#27675.
Doctrine entity listeners are always lazily instantiated as of Symfony 4.2.