After read Dotrine Doc again, I've found a solution. Like my second Edit, you just have to create a ScalarField. I give you an exemple.
$rsm = new ResultSetMapping;
$rsm->addEntityResult('Btp\UserBundle\Entity\User', 'u');
$rsm->addFieldResult('u', 'id', 'id');
$rsm->addFieldResult('u', 'name', 'name');
$rsm->addJoinedEntityResult('Btp\UserBundle\Entity\Question' , 'q', 'u', 'questions');
$rsm->addFieldResult('q', 'question_id', 'id');
$rsm->addScalarResult('nb_questions', 'nbQuestions');
$sql = 'SELECT u.id, u.name, COUNT(q.id) as nb_questions
FROM user AS u
INNER JOIN question AS q ON u.id = q.auteur_id
GROUP BY u.id
ORDER BY nb_questions ASC';
$query = $this->_em->createNativeQuery($sql, $rsm);
return ($query->getResult());
In this exemple, Doctrine return an array of User, and you can access to them by :
(we suppose that $askers have the return result of the code below)
$askers->[0][0]->getName() //return the name of the first User in array
And if you want your ScalarField, Doctrine set a new field in the return array, so:
$askers[0]["nbQuestions"] // give the result of your ScalarField, in this case the
question's number of the first User of the array
Thank, Hope it's could help!