Copy values rather than create a new instance?
tommyiraone opened this issue · 2 comments
tommyiraone commented
How do I copy values from a source object to an existing destination object rather than create a new one?
maybe like..
$mapper->map($sourceObject, $destinationObject) ??
mark-gerarts commented
Hi @tommyiraone. Which version are you using? In 1.x you can do the following:
$mapper->mapToObject($sourceObject, $destinationObject);
In 2.x (beta) this is part of the map
function, meaning your example would work.
tommyiraone commented
I'm using 1.x
sorry for that, I think I have missed that one.
Thank you.