Skip to content

Copy an existing ParseObject #267

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

Closed
aBuder opened this issue Sep 8, 2019 · 1 comment
Closed

Copy an existing ParseObject #267

aBuder opened this issue Sep 8, 2019 · 1 comment

Comments

@aBuder
Copy link

aBuder commented Sep 8, 2019

Hi,

what is the best way to copy an existing ParseObject? In my example I have template object with child object. If user will create a new object from template, I have to copy object from template object and append user relation. The new copy object should be saved later and have an new objectId

@phillwiggins
Copy link
Member

Hey @aBuder

As there is no reflection in Dart, we have to create slightly hacky version. Try something like this:-

User clonedUser = user.clone(user.toJson(full: true, forApiRQ: false));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants