You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a situation where we have objects that are somehow linked to other structures (an object references a file on disk in our case). When the deep copy of a data tree is performed, the objects are cloned inside, but we also need a hand on the old and new objects together to be able to copy the associated structure at the same time (cp files on disk here).
I don't see a way to do that currently, we thought about the type filter/type replace but we don't want to "manually" clone the object as would be with this filter, we are perfectly good with the normal cloning, we just need to know when one was cloned to perform the additional operations we need.
What would be the best way to do it? Events? Callbacks? Type filters that can be chained?
The text was updated successfully, but these errors were encountered:
what about the regular __clone for the object encapsulating that file? DeepCopy can use it instead of performing a deep clone so that regular objects would have your custom behaviour
@theofidry I want the deep clone behavior (mostly because the data is doctrine entities), but also would like to be able to perform something after the cloning of some of the objects in the data tree
__clone would do something like that, but it would remove the deep cloning and I wouldn't use deepcopy if I could just go with the standard clone :-)
We have a situation where we have objects that are somehow linked to other structures (an object references a file on disk in our case). When the deep copy of a data tree is performed, the objects are cloned inside, but we also need a hand on the old and new objects together to be able to copy the associated structure at the same time (cp files on disk here).
I don't see a way to do that currently, we thought about the type filter/type replace but we don't want to "manually" clone the object as would be with this filter, we are perfectly good with the normal cloning, we just need to know when one was cloned to perform the additional operations we need.
What would be the best way to do it? Events? Callbacks? Type filters that can be chained?
The text was updated successfully, but these errors were encountered: