Closed xorik closed 6 years ago
@michaelperrin is currently working on porting the solution from DoctrineBundle to this bundle: https://github.com/doctrine/DoctrineMongoDBBundle/pull/441#issuecomment-348694857
I confirm I started working on it, and I should be able to open a PR this week.
Sorry ) No news about PR?
@seqq I am sorry I am still working on it and it should be ready soon!
great to hear, thank you!
@seqq you can use my code, just put it in your namespace. It works perfectly
@michaelperrin any news? :)
@malarzm I am so sorry for the delay, life took over this ;) I could push a WIP PR if needed, which is a port of the ORM counterpart, but which is not finished yet. I keep you posted by the end of the week.
@michaelperrin no worries at all! Please push the WIP, if you could highlight what is left to do maybe someone will be able to help :)
made it work following https://github.com/doctrine/DoctrineMongoDBBundle/pull/448/files and the code of @xorik
@malarzm Sorry again for the delay, here is the WIP PR: #449 . I hope to work on it again soon!
Is this related to the exception I'm getting:
Cannot autowire service "App\Repository\TestRepository": argument "$uow" of method "Doctrine\ODM\MongoDB\DocumentRepository::__construct()" references class "Doctrine\ODM\MongoDB\UnitOfWork" but no such service exists.
I'm using Symfony 4 with DoctrineMongoDBBundle and trying to set up a simple Document + RepositoryClass using annotations.
Is this related to the exception I'm getting
Yes. ODM repositories are not suited for autowiring (yet).
See #473.
The ORM bundle have a helper class to make repositoires autowired. The class is
ServiceEntityRepository
. Example is here.It would be great, if ODM bundle have the same for the
DocumentRepository
class.I think something like this should work: