You could do it this way, without the need to convert data.
In the query, do not select all the object of the entity but only fields you want. This way the query returns an array of arrays, like:
$results = array(
0 => array('col1' => 'some_data', 'col2' => 'some_other_data'),
1 => array('col1' => 'some_data', 'col2' => 'some_other_data')
);
and not like:
$results = array(
0 => Object of type Categories(for example),
1 => Object of type Categories(for example)
);
The query should be like this:
$em->createQueryBuilder('c')
->select('c.name, c.shortName, c.some_column')
->from('AppBundle:Entity:Category', 'c')
->getQuery()
->getResult();