mapper-php
mapper-php copied to clipboard
Option to map data into collection instead of arrays.
It would have been nice to have an option to map data into collections, for example ArrayObject, instead of arrays.
I propose a new annotation;
@destination ArrayObject
So, the @destination annotation would pass the value to the constructor of the class given?
In this example, the value of the mapped property will be new ArrayObject($value) ?
Exactly, the value would be passed to the constructor.
Additional improvements;
- Use doctrine annotation to improve performance
- Support aliases and use statement, so we don't need to state the full namespace of the subject. Example (https://gist.github.com/Zeronights/7b7d90fcf8d4daf9db0c)