Symfony Doctrine event subscriber is not listed in debug: event-dispatcher

Symfony v3.3.4, Doctrine ORM v2.5.6

I created an event subscriber for the doctrine object:

AppBundle\EventListener\LivreSubscriber:
    tags:
        - { name: doctrine.event_subscriber }

      

All perfectly! But for a long time I didn’t work because the listener is not specified in the debug: event-dispatcher command:

$ docker-compose exec phpapp bin/console debug:event-dispatcher doctrine.event_subscriber

[WARNING] The event "doctrine.event_subscriber" does not have any registered listeners.

      

The same goes for the event listener. And also: neither listener nor subscriber are specified in the symfony profiler (Event section) ... So this works, but it's strange that listeners are not specified in the debug tool, isn't it?

Can you tell me if you have the same behavior with your projects ...

+3


source to share


1 answer


This subscriber is a doctrine subscriber, not symfony. Doctrine uses its own event manager that is not related to the symfony event manager. console debug:event-dispatcher

only subscribers registered with Symfony Event Manager are listed.



+4


source







All Articles