phpcr-odm
phpcr-odm copied to clipboard
add failing test for #659
so there a two conditions to make that test fail
- add an preUpdate Listener to the parent class
- make sure the parents ChildrenCollection is initialized without either one of these conditions the test passes!
when we restrict preUpdate to fields only, there remains one failing test (see travis). Not sure, if this is the way to go. But I see no other simple solution for #659. I think it would be safer anyway to restrict the possible changes to a documents fields as there a no other changesets computed after the event. But that currently leaves us with no way to reset the order of children (maybe this should be allowed).
I think this needs some discussion ...
events during the flush seem to be a really tricky beast. do you see a way to allow field updates and reorderings, but no renaming? or could we store the renaming operation in a way that the second changeset calculation can check if something was renamed and not get confused?
could we look at object identity rather than paths? uuid would only be something for 2.0 as we would change everything to have a uuid.
I can try to look into the reordering but I fear this will not be an easy thing to fix.
what are our other options? limiting event listener to update properties?
That's already done here, with the one test about reverting the reordering of the children in preUpdate failing, i.e. that would be a bc break of some kind.