Skip to content

Directly map source object to target array since v1.1.0 #43

Answered by priyadi
ToshY asked this question in Q&A
Discussion options

You must be logged in to vote

As of 1.1, the mapper is fully capable of handling arrays as mentioned in the documentation. Thing is that array is supported, only not as the root object.

The problem is now we are bound to MapperInterface. I decided on map() taking an object and returning an object to simplify the job of those who want to extend the mapper.

In the future, I'll probably create something like MixedMapperInterface that accepts and returns mixed. But I still have to figure out how to specify array as the target, do we use the string 'array' or specify an empty array []? Then there is a question on the use cases where the source is a collection, and we want to map it to array<int,Something>

I think I'll defe…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ToshY
Comment options

Answer selected by ToshY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants