I wrote a DQL query in Doctrine 2:
$qb->select('r.position') ->from('\Entities\Races', 'r') ->where($qb->expr()->eq('r.entrantId', ':entrant_id')) ->setParameter('entrant_id', $this->entrantId); $query = $qb->getQuery(); $aRaces = $query->getResult();
It currently returns query results in an array as follows:
Array ( [0] => Array ( [position] => 10 ) [1] => Array ( [position] => 4 ) )
I want the result to return an array of Races objects so that I can access the methods associated with the object (I'm sure the previous version of Doctrine returned objects by default).
I tried:
$aRaces = $query->getResult(Query::HYDRATE_OBJECT);
But that didn't matter.
Rate help
source share