propelorm/Propel2 — pull request #595 by gharlan (2014-03-30 11:53:17+00:00)
Title: use IteratorAggregate for Collections, so nested iterations are possible

At the moment nested iteration over the same collection is not possible because the Collection is the Iterator itself and so there is only one array pointer for current position.
I suggest to use the `IteratorAggregate` interface instead.

I came up to this by using a `preSave` hook where I iterate over a collection. But at call time Propel was iterating over the same collection in the `doSave` method of a relational object. So my foreach-loop was modifying the internal pointer of the Collection and some objects were not saved.