How to get a Collection in Doctrine2's query results

前端 未结 3 2007
误落风尘
误落风尘 2021-01-31 02:42

I am trying to execute a query using doctrine2 and need it to return a collection object.

Simplified snippet:

$players = $this->getEntityManager()
            


        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-31 03:22

    to return an object instead of array, you have to use "Partial Objects".

    here is tested code example https://stackoverflow.com/a/12044461/1178870

提交回复
热议问题