Hi ,
what is the right way to create a bean from another existing bean ? in other words, how to duplicate bean in sugar in PHP.
i want to keep relationship too.
Hi ,
what is the right way to create a bean from another existing bean ? in other words, how to duplicate bean in sugar in PHP.
i want to keep relationship too.
Not all relationships can be easily copied. Do you intend to copy each of the related records? Some relationships are 1:1 or 1:M.
For example, if you have a contactBean. You can clone the contactBean and unset the ID and indicate that it is new. Save the bean and then loop through each relationship to determine what to do.
What is your use case?
hi,
clone + ->new_with_id + generated_id seems to do the work.
i've got 1:n relationship and they are here. all is ok
thanks for your help