-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provide migrating document class on DocumentManager too #420
Comments
I think also a more generic |
i agree. we had endless discussions in #262 about automatically merging / replacing documents. for an explicit replace operation, there are already many options: either replace just the document itself but keep children of the old document, or only keep the new children (so if the new has no children, remove all old children), or merge children and take the new or the old child in case of a conflict (and then how to merge the children of children?). when we flush a whole model tree, this is not explicit, and even more tricky. maybe we should say that then a replace can't happen, that it always has to be explicit... |
Hmm. I think if you are going to remove the node and its children, then you may as well do |
the problem with remove & persist new is that all children of the old document are removed as well. when this is intended, it can make sense to do this (though you noticed that it does not work in the same flush i think) |
there is now a command to migrate a document from one class to an other, but this would be useful functionality through code as well.
https://github.com/doctrine/phpcr-odm/blob/master/lib/Doctrine/ODM/PHPCR/Tools/Console/Command/DocumentMigrateClassCommand.php
The text was updated successfully, but these errors were encountered: