doctrine/mongodb-odm — pull request #329 by jmikola (2012-06-18 15:29:31+00:00)
Title: Fix PersistentCollection cloning

See [DDC-1643](http://www.doctrine-project.org/jira/browse/DDC-1643) and doctrine/doctrine2@9fc1d85e8dd9db217d895c923f3d0d3a26ead6f1.

This entailed some refactoring to the field `foreach()` in `computeChangeset()`, which I believe improved readability although it can certainly be improved. The ORM fix port is in its own subsequent commit.

One question I have is whether PersistentCollection's `changed()` method might need special handling for embedded mappings vs. references. Otherwise, the port is quite straightforward.