I'm trying to generate a nativeQuery using a mixed ResultSetMapping that contains entities and scalar results. For example:
$rsm = new ResultSetMapping();
$rsm->addEntityResult('MyBundle:Evaluation','e');
$rsm->addFieldResult('e','id','id');
$rsm->addScalarResult('company','company');
when i {{dump()}} one of the query result elements, it looks like this:
array:2 [▼
0 => Evaluation {▼
#id: 24
}
"company" => "INRA"
]
So in the result array, the company is identified with the "company" key while my Evaluation entity is identified with the "0" key.
My question is: is there another way to access entities defined in ResultSetMapping() other than with their numeric key ? like ScalarResults ?