I just started Symfony2 web app project and I'm stuck at a particular problem:
I have users and I have one subscriber to doctrine events (postUpdate and postPersist) to dispatch custom events, so:
- User is updated
- Doctrine flushes User
- Doctrine subscriber act on postUpdate dispatching 'user.updated' event
- Custom event subscriber act on 'user.updated'
Everything goes fine up to that point. What I need to do now is... I need to dispatch 'user.updated_current' if the user modified is current user from within that custom event subscriber (which also subscribes to 'user.updated_current').
Unfortunately 'user.updated_current' event, despite being dispatched, is not handled by my custom event subscriber.
I'm wondering if I actually can dispatch events from within Symfony's event subscriber?