doctrine/mongodb-odm — pull request #302 by asafdav (2012-05-06 13:18:55+00:00)
Title: Fixed a bug of nested documents that use "set" strategy.

A nested structure that is defined using "set" strategy will persist badly after flush.
It will be easier to explain this bug by example, so lets define two documents: Post which is a document that contains a collection of Comments (EmbedMany using "set" strategy). Comment is an embedded document that contains a collection of comments (set strategy as well).
Lets assume "A" is a post that contains one Comment "B" that contains one comment "C" (c->B->A).
After flush, C will become B sibling instead of child.

The wanted result is:
A
|
---> B
|
---> C

While the actual result is:
A
|
---> B
|
---> C

I've fixed this issue and enchaned CollectionPersisterTest to ensure proper behaviour after the fix.