In a Symfony2 application, I have an entity that needs to be populated on pre-persist with various context properties (like user id, what page it was called from, etc.)

I figured that to do this, I need to add a doctrine event listener that has access to "service\_container", and the best way to give such access is to pass "service\_container" as an argument to this listener.

I have a specific entity that I want to listen to, and I do not want to trigger the listener to events with any other entity. 

We can add an entity-specific listener, documentation is found here:
<http://docs.doctrine-project.org/en/latest/reference/events.html#entity-listeners>
 - but this does not provide example of how to pass an argument (I use PHP annotations to declare the listener).

I also tried to use JMSDiExtraBundle annotations, like in the example below:
<http://jmsyst.com/bundles/JMSDiExtraBundle/master/annotations#doctrinelistener-or-doctrinemongodblistener>
 - but this way requires to declare the listener as non-entity-specific

Is there any way to make a listener for one entity only, and have it have access to container?