I am trying to execute a query using doctrine2 and need it to return a collection object.
Simplified snippet:
$players = $this->getEntityManager()
to return an object instead of array, you have to use "Partial Objects".
here is tested code example https://stackoverflow.com/a/12044461/1178870