data-transfer-object icon indicating copy to clipboard operation
data-transfer-object copied to clipboard

Enable object with MapTo properties to be cloned (Fix #272)

Open gerpo opened this issue 2 years ago • 1 comments

This PR adds a flag to ignore the MapTo attribute. In some cases, it could be useful to get the original keys instead of the mapped ones when you export a data object to an array. This is also the easiest way to fix the bug in issue #272 as we can just pass true for the $keepOrginalKeys flag and don't walk into any array merging issues.

With the default value of false we also don't risk any breaking changes. If the flag is not passed, we get the same behavior as right now.

gerpo avatar Jun 03 '22 14:06 gerpo

Thanks for the PR, @gerpo. What's the use case for this outside of fixing #272?

aidan-casey avatar Jun 03 '22 15:06 aidan-casey

Could this be merged in? This is blocking us from cloning a DTO with multiple MapTo props.

danielhomer avatar Sep 28 '22 13:09 danielhomer

We are stopping maintenance on this package.

Consider migrating to spatie/laravel-data or cuyz/valinor

freekmurze avatar Nov 01 '22 08:11 freekmurze