Closed smoelker closed 6 years ago
You are right, MapFromWithMapper
should be a solution for this. I'll bump the version so it'll become available on pacakagist.
I'll look into the following things later:
A new operation that is also fluent would be convenient, like this:
Operation::fromProperty('adres)->mapTo(Address::class);
Just a suggestion :)
The nameresolver not working in your example was indeed a bug. I've fixed it on master, so if you want to use that, you can pull the latest version. Meanwhile I'm gonna start looking into your suggestion and see what I can do. No promises though :)
FromProperty
has been extended to allow chaining as you suggested. It's sitting on master for now, so it'll be included in the next release.
I'm trying to map a nested property (using mapTo) where the source property name and the target property name are different but I can't seem to find a way.
I tried mapTo and fromProperty combined:
I tried a mapTo combined with a name resolver:
None of them seem to work.
I suspect that MapFromWithMapper would do the trick but that change has not been published to packagist it seems. Am I missing something here?