-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Allow multiple doctrine ORM instance #96
Conversation
75d71d2
to
6dedf04
Compare
I don't really know why the tests fails. It does not seems related to this PR |
6dedf04
to
24b4792
Compare
f4ea795
to
8b6fe42
Compare
Thanks for the PR! The tests seem to fail due to a new release of the Doctrine packages which introduces more deprecation notices. No biggie, but that would need to be fixed in a separate PR. Regarding the PR itself, I'm having a bit of trouble to understand: so the strategy is to "duplicate" the current services per entity manager and then you leave the responsibility to the user to pick the right one? |
@theofidry Yes, I used the same strategy that doctrine uses. Imagine you have the following doctrine configuration: doctrine:
orm:
default_entity_manager: foo
entity_managers:
foo:
connection: xxx
# etc.
bar:
connection: xxx
# etc. Then doctrine bundle will generate:
(and it will also generate 2 services for each cache, entity_listener, etc.). I applied the same strategy here:
|
The difference is that when you persist an object with Doctrine, provided you have multiple connections/managers, you want to specify which one as wanting to persist it for all of them is much less likely. In alice however, I think it would be more common the other way around: if you have an entity managed by a manager and another entity manager by another, I think most people would like Alice to figure out which manager should be used for which entity. So I think a different approach that would work better for most cases would be as @dkarlovi mentioned on Slack:
Maybe @dkarlovi can also help you out with the implementation |
Any updates on this ? This fix would be appreciated 😄 edit : I did some work (still WIP, need to test) here : #99 |
Sorry all, I should really queue these tasks better, I should have done a follow-up here, my bad. |
Fixes #90