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

Add support for cross om references. #625

Merged
merged 1 commit into from
Mar 5, 2013
Merged

Add support for cross om references. #625

merged 1 commit into from
Mar 5, 2013

Conversation

jwage
Copy link
Contributor

@jwage jwage commented Mar 5, 2013

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.

@l3pp4rd
Copy link
Contributor

l3pp4rd commented Mar 5, 2013

looks great ! thanks

l3pp4rd added a commit that referenced this pull request Mar 5, 2013
[WIP] Add support for cross om references.
@l3pp4rd l3pp4rd merged commit 963a4c8 into doctrine-extensions:master Mar 5, 2013
@bobthecow
Copy link
Contributor

Yep. I think you're right @jwage, I've seen this before :)

@lsmith77
Copy link

lsmith77 commented Mar 5, 2013

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];
}
Copy link
Contributor

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.

Copy link

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.

Copy link
Contributor

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)

Copy link
Contributor Author

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.

@stof
Copy link
Contributor

stof commented Mar 5, 2013

@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.

@webdevilopers
Copy link

I tried the cross reference extension with the code provided by @Devlopnet here:
#750
But persisting the Document does not set the mapped field.

I guess I am missing some kind of configuration to make my server aware of the reference extension resp. listener. Unfortunately I havn't found any reference related config in the docs.

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

Successfully merging this pull request may close these issues.

6 participants