You should enter the container using the "calls" option, and not as an argument, which I think:
services:
product_admin_controller:
class: Application\Sonata\ProductBundle\Controller\ProductAdminController
arguments: ["@another_service_you_need"]
tags:
- { name: doctrine.event_listener, event: postLoad, connection: default }
calls:
- [ setContainer,["@service_container"] ]
Also, be sure to create the public "setContainer ()" method in your listener class.
source
share