In my configuration file, I defined a custom object manager:
parameters:
doctrine.orm.entity_manager:
class: Strict\UserBundle\Entity\Manager\MyEntityManager
Is there a way to inject / add the @session service (I need to access the getLocale () method) in this entity manager? I tried this:
parameters:
doctrine.orm.entity_manager:
class: Strict\UserBundle\Entity\Manager\MyEntityManager
arguments:
session: "@session"
but it throws this exception:
InvalidArgumentException: You cannot dump a container with parameters that contain references to other services (reference to service "session" found in "/doctrine.orm.entity_manager/arguments/session").
Any ideas?
source
share