Getting a list with every listeners on Symfony2
You can get event dispatcher from container and take a look at events with getListeners
function. Example in controller
$evd = $this->get('event_dispatcher');$listeners = $evd->getListeners();
Description
/** * Gets the listeners of a specific event or all listeners. * * @param string $eventName The name of the event * * @return array The event listeners for the specified event, or all event listeners by event name */public function getListeners($eventName = null);
Be careful, doctrine has own event dispatcher.
/** @var $em EntityManager */$em = $this->getDoctrine()->getManager();$evd = $em->getEventManager();$listeners = $evd->getListeners();