-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update documentation to explain service repositories #516
Comments
About that, what's the difference between ServiceRepository and "basic" Repository ? In my case I managed to have autowired Repositories by doing the following:
As the I can then inject the Repository in my Services. |
Nothing - the final class FooRepository extends ServiceDocumentRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Foo::class);
}
} |
Not entirely nothing, injecting |
I never had the case with multiple managers yet. In that case how the |
With each manager's mapping configuration you're setting which documents are managed by a document manager. Although I believe it's not enforced, one document should not be managed by two separate document managers. This way given a class, |
Oh yeah I missed that part as I didn't need that. Thanks a lot for the explanation. |
One more thing: when fetching the repository from the container you will receive a different instance from the one you receive from |
The documentation at https://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html doesn't contain a section on service repositories, which should definitely be added.
The text was updated successfully, but these errors were encountered: