Skip to content
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

The configuration of Entity Listeners is confusing #732

Closed
ntoniazzi opened this issue Nov 7, 2017 · 5 comments
Closed

The configuration of Entity Listeners is confusing #732

ntoniazzi opened this issue Nov 7, 2017 · 5 comments

Comments

@ntoniazzi
Copy link

The documentation for configuring Entity Listeners is not clear to me. It states that starting with doctrine/orm 2.5, you don't need to declare the @ORM\EntityListeners in the entity.

But then, how is the Listener linked to the Entity (I couldn't make it work without the annotation).

I also tried to configure the listeners in the yaml file (path doctrine.orm.entity_managers.{manager}.entity_listeners.entities) without success.

Am I missing something?

Thanks.

@paulj3
Copy link

paulj3 commented Mar 20, 2018

@ntoniazzi - agreeed. I am trying to register a listener with a service dependency with no luck.

@kimhemsoe
Copy link
Member

We always welcome pull requests :)

@kimhemsoe
Copy link
Member

Without more information there is not much i can do help with. The best i can do is to point you in the direction of the tests, which have some examples.

@kimhemsoe
Copy link
Member

dup of #457

@Steveb-p
Copy link

@kimhemsoe this is probably not a documentation issue. I'm having trouble registering an EntityListener with some dependencies myself and failed to do so. I've went back to using EventSubscriber instead.

I've tried looking into EntityListenerPass and checking if it registers to the proper resolver, and sure enough it does. However, whether I specify @ORM\EntityListeners annotation with my class inside or not - events were not firing :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants