Update: Yes there is! I wrote a small rudimentary library, which can be downloaded here: http://automapper.nylle.de
Original answer: I have not heard about this, but I assume that this is unlikely, since PHP does not support return types for methods or functions. How can you map the properties of two different classes if you can only reflect their names, but not their types?
You can still write a small static helper class that simply gets two flat objects and copies all the values ββfrom one property to the property of another class with the same name using reflection , but this will only work if you know what you are doing and types can be convertible (for example, scalar types string / INT / BOOL).
Perhaps you can add some robustness to parsing the phpdoc part (if any) to get an idea of ββthe return type.
source share