-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for cross om references. #625
Add support for cross om references. #625
Conversation
looks great ! thanks |
[WIP] Add support for cross om references.
Yep. I think you're right @jwage, I've seen this before :) |
it would be good to also support other ODMs. see also https://github.com/netvlies/DoctrineBridgeBundle /cc @markri |
public function getManager($type) | ||
{ | ||
return $this->managers[$type]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to register several ManagerRegistry instances (one for the ORM, one for the MongoDB ODM and so on) rather than registering managers directly ? It would keep them lazy-loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes .. especially once multiple ODMs are supported. also it might even make sense to allow to define a manager name. this way one could even map between two separate EntityMangers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, currently, you can (using orm_1
and orm_2
as type).
Once it is switched to registries, this could be supported without the explicit name by using getManagerForClass
(but it will be a bit less efficient than knowing the manager name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would be much better. This code was originally written > 2 years ago so it pre-dates the ManagerRegistry. I hope to spend more time on this soon.
@lsmith77 References to other ODMs should already work if you register them (to be tested though). References from other ODMs would require implementing the appropriate adapters in the extension to support them. |
I tried the cross reference extension with the code provided by @Devlopnet here: I guess I am missing some kind of configuration to make my server aware of the |
We use this @opensky and it has been quite useful for us. I finally got some time to clean it up a little and contribute it back upstream. Originally written by @avalanche123 and I am pretty sure @jmikola and @bobthecow may have worked on it.