i think this is assuming doctrine collections. the interface says "array" so we should not assume this. maybe we should delegate the actual reordering to the mapper, as its implementation specific. i am not sure if the doctrine orm collections are ordered - maybe its really just the phpcr-odm children collection. in orm, order would be a "order" or "position" or similar column in the database i guess. supporting explicit children ordering is a phpcr speciality.

maybe we need to add a sortChildren method to RdfMapperInterface for this where you can pass an ordered array with the desired order of children? @flack: or how would you solve that?