Skip to content
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

Use multiple Entity Managers and Connections #55

Open
PGBastien opened this issue Aug 4, 2017 · 1 comment
Open

Use multiple Entity Managers and Connections #55

PGBastien opened this issue Aug 4, 2017 · 1 comment

Comments

@PGBastien
Copy link

I have multiple Entity Managers and Connections in my Symfony project and all is OK
https://symfony.com/doc/current/doctrine/multiple_entity_managers.html

Now I would like to use multiple Entity Managers in my resolvers or fields but I do not know how to do.

Thanks

@PGBastien
Copy link
Author

PGBastien commented Aug 8, 2017

If this can help you, in my services.yml

I create new em
em_other: class: Doctrine\ORM\EntityManager factory: ['@doctrine', 'getManager'] arguments: ["other"]

and new resolver base
resolver.other: class: AppBundle\Resolver\AbstractResolver abstract: true calls: [ init, ['@em_other']]

and edit parent of resolver
resolver.customers: class: AppBundle\Resolver\WstiersResolver parent: 'resolver.other'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant