-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Reorganization and integration of "Entity Listeners" (Doctrine Bundle) #10209
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
See symfony#10198 Some formatting is still missing, especially the last headings need to be downgraded one level. What would be an appropriate title for the page? What about "Doctrine Listeners"?
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.
Looks pretty good to me, a good idea having everything about listeners in the same place. Should we perhaps link to the docs for DoctrineBundle? https://symfony.com/doc/current/bundles/DoctrineBundle/entity-listeners.html
services: | ||
App\EventListener\UserListener: | ||
tags: | ||
- { name: doctrine.orm.entity_listener } |
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 order to leverage the autowire: true
feature, you can create and empty interface EntityListenerInterface
which all your entity listeners implement, then add this to your services.yaml
:
services:
_instanceof:
App\EventListener\EntityListenerInterface:
tags: [doctrine.orm.entity_listener]
Then you don't need to define all your entity listeners as services.
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.
This is certainly a good idea, but I (for myself) don't want to change anything anymore before this gets merged, cause I need to see the final rendered page first, to find a nice place for this.
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.
That's a good point. You've got some merge conflicts at the moment though. Once you fix them up I'll approve 👍
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.
@ThomasLandauer you can build the documentation locally with your changes, https://symfony.com/doc/current/contributing/documentation/overview.html#build-the-documentation-locally that way you can see how it looks before it gets merged
@ThomasLandauer I'm sorry we didn't merge your contribution on time. Since then, we've decided to reword Doctrine docs entirely, including the ones related to events (see #12328). That's why we're closing this pull request in favor of the new one. I'm really sorry. |
@javiereguiluz Well, after ignoring this for almost a year, you could at least have taken 10 minutes to check if there's something valuable in here that you could use:
And please take a look at #10180 and help me out! I don't want the same outcome there... |
Yes, we did that on purpose. We don't want to include an exhaustive list of events because they are documented in the official Doctrine docs and they can change ... so, we don't want to repeat that in our docs and we don't want to complicate our doc maintenance even more. About your contributions, I'd like to tell you something. Sadly we're "ignoring" or closing without merging most of your contributions. Please, don't think there are some reasons to do that. We don't have anything against you or your contributions. The problem is that the kind of contributions you've made are tough for us because:
So, again, please don't think we have anything against you or your contributions. Thanks. |
Doctrine Events: General: Any contribution I made resulted from myself needing it. When I look something up in the docs, and I have difficulties to follow (or missing something), I improve it. So anything I suggest fixes a "real" problem - in the sense that at least one real user (=me) stumbled over it. Details: Well, sometimes it's the last 1% that's the hardest... ;-) Your point "complicate too much the reading" is totally on the wrong track, IMO! Nobody reads this like a novel, from beginning to end. If it is hard to follow, then it's not because of too many details, but because of bad structure (i.e. bad/missing heading, boxes etc.): If I tell you "Here is the full list of our 75 whatever's:", and you don't need them right now, what will you do? You're saying: "Read all of them and get confused". I'm saying: "Skip this section for now." |
See #10198
Some formatting is still missing, especially the last headings need to be downgraded one level.
What would be an appropriate title for the page? What about "Doctrine Listeners"?