Skip to content


DDC-935: copy function needs implementation #5464

doctrinebot opened this Issue · 4 comments

2 participants


Jira issue originally created by user jackvangalen:

The (deep)copy function of the entity manager is not yet implemented. I assume this is known, but I could not find any open issue on it. This is a pretty powerfull feature once implemented. The function body is completely empty however. Perhaps the tried code could be added so I and others could try and resolve the known issue with this function (recursion limit reached).


Comment created by @beberlei:

There was never code written for that function. I don't think its too problematic that this is missing. You only have to implement **clone (and do so safely as the docs/cookbook describes) and then pass this structure to persist. Optionally making use of cascade persist.


Comment created by mstoehr:

I recently came accross this. Is there any best practice if you have to clone an entity who has several associations? I thought of grabbing them and clone them one by one. Or is there a more convenient way?


Comment created by @beberlei:

no, except implementing **clone and doing it there.

Doctrine member

@Ocramius Btw what we discussed on SymfonyCon might actually be removing merge and implementing copy instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.