stephpy / timeline-bundle

Symfony2 bundle to make timeline
193 stars 57 forks source link

ODM composite key support #98

Open stephpy opened 11 years ago

stephpy commented 11 years ago

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 commented 11 years ago

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

stephpy commented 11 years ago

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 commented 11 years ago

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

stephpy commented 11 years ago

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.