I need to use a native query, because I need to ORDER BY RAND() and it’s currently not possible (afaik) even with custom function.
However, if I use native query, I need to explictly set the column to fetch to allow an Object Hydration, and you may guess, I’ve a lot of column, so it’s kinda boring to set it all.
Any ideas?
You should never use
ORDER BY RAND()even in native query, you should useSELECT rand() as rand,* .... ORDER BY randI think it is quite possible with doctrine