[DDC-1819] Allow ResultSetMapping to be used for objects that are not entities Created: 11/May/12 Updated: 14/May/12
|Project:||Doctrine 2 - ORM|
|Reporter:||Marijn Huizendveld||Assignee:||Benjamin Eberlei|
Currently Doctrine\ORM\Query\ResultSetMapping can only be used to query the database for entities using the EntityManager::createNativeQuery method. It would be great if we could use this as well for objects that are not entities. That way we can create simple DTO's and map them to a query using the ResultSetMapping.
I'll open a PR If there are no objections.
|Comment by Benjamin Eberlei [ 11/May/12 ]|
Good idea. You could make this happen by adding a ArbitraryObjectHydrator that does not use the ClassMetadata but creates ReflectionProperty instances during the hydration.
Api would then be:
|Comment by Marijn Huizendveld [ 13/May/12 ]|
Thanks for your input. I'll try to work on some tests this week.
|Comment by Marijn Huizendveld [ 14/May/12 ]|