Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

ThomasLandauer
Copy link
Contributor

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"?

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"?
Copy link
Contributor

@ndench ndench left a 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 }
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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 👍

Copy link
Contributor

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

@javiereguiluz
Copy link
Member

@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.

@ThomasLandauer
Copy link
Contributor Author

@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...

@javiereguiluz
Copy link
Member

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:

  1. Some include too many details. You even replied to one of our reviews: "I don't know why you don't like to explain details in the docs". It's not that we don't like that ... but sometimes, details complicate too much the reading or complicate our future maintenance of docs.
  2. Some include too many changes; like the one with the rewordings that you mentioned. It's really annoying to merge contributions like that because of the conflicts, etc.

So, again, please don't think we have anything against you or your contributions. Thanks.

@ThomasLandauer
Copy link
Contributor Author

Doctrine Events:
Yeah, that's why I introduced it with "Here are some popular events" and then linked directly to https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/events.html#lifecycle-events

General:
I see your point. And I can imagine that it's hard to review stuff. Are you doing this on GitHub's webpage or do you have a better way?
Anyway, you need to be aware that what you're saying, essentially, is: "Just fix some typos and leave the rest up to us."

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."

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.

5 participants