Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

ODM composite key support #98

Open
stephpy opened this issue Feb 19, 2013 · 4 comments
Open

ODM composite key support #98

stephpy opened this issue Feb 19, 2013 · 4 comments

Comments

@stephpy
Copy link
Owner

stephpy commented Feb 19, 2013

Look at #96

Hi, i saw there is an issue on TimelineBundle ODM with new versions of doctrine mongo ODM Bundle since they change behavior of hash field type.

First behavior was like ORM. You set a STRING identifer (ABCD), it'll store a serialization of that. You set an ARRAY identifier (for composite keys), it'll serialize it too.

Setting this as string is great but you'll have to make some changes to supports composite keys.

@vkartaviy
Copy link
Contributor

Doctrine MongoDB ODM doesn't have composite primary keys, or am I wrong?

@stephpy
Copy link
Owner Author

stephpy commented Feb 19, 2013

Yes, but you could refer to an other stored entities:

Storing TimelineBundle with driver ODM but having user via ORM with composite keys. If you cannot store an array of keys on Component table, on mongo you'll not be able to identify User.

Components can be stocked in any type of storage.

@vkartaviy
Copy link
Contributor

I got your point. I totally forget about storage combinations...

@stephpy
Copy link
Owner Author

stephpy commented Feb 19, 2013

We should repeat the behavior for hash field type in ORM. It's a string field type which is serialized/unserialized.
It could be added on Document/Component.php identifier setter/getter.

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

No branches or pull requests

2 participants