How do I correctly set up the service container in my Symfony 2 application to support custom Document repositories?
What I have so far is:
services:
acme.repository_user:
class: Acme\Repository\UserRepository
arguments: [@doctrine.odm.mongodb.document_manager]
However, when I look at the constructor of the DocumentRepository
class, of which my UserRepository
inherits, I can see the following arguments:
public function __construct(DocumentManager $dm, UnitOfWork $uow, Mapping\ClassMetadata $class)
I seem to have injected the document manager but how do I inject the Unit of Work and the class meta data?