Reputation: 2802
I have two doctrine objects, where one is the temporary object i need to move all the values to the original object
$orgObject = $em->getRepository('Acme:demo')->get($id);
$tempObjec = new demo();
How can i copy one value to other, this is just scenario i am saying
Upvotes: 1
Views: 95
Reputation: 5133
Try:
$tempObjec = clone $orgObject;
If you have linked object you may define the method __clone of your class:
public function __clone()
{
// ...
}
Upvotes: 4