[DDC-935] copy function needs implementation Created: 15/Dec/10  Updated: 02/Jan/11

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.0-RC2
Fix Version/s: None
Security Level: All

Type: Task Priority: Minor
Reporter: Jack van Galen Assignee: Roman S. Borschel
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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).



 Comments   
Comment by Benjamin Eberlei [ 15/Dec/10 ]

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 by Marcus Stöhr [ 01/Jan/11 ]

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 by Benjamin Eberlei [ 02/Jan/11 ]

no, except implementing __clone and doing it there.

Generated at Wed Oct 22 23:33:51 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.