Closed MlleDelphine closed 7 years ago
Ok, I found a solution to do that but I keep thinking that "setEntityManager" should be integrated.
My solution, for others :
$em = $this->getDoctrine()->getManager("custom_maanger");
$dataT = $this->get('datatable');
$queryBuilder = new QueryBuilder($em);
$doctrineQueryBuilder = new DoctrineBuilder($em, $this->get('request_stack'));
$doctrineQueryBuilder->setDoctrineQueryBuilder($queryBuilder);
return $dataT
->setEntity("APIBundle:FSProject", "p")
->setFields(
array(
"_identifier_" => 'p.trackingNumber')
);
I had to switch from AliDatabundle to another which is compatible with Symfony 3.
Unfortunatly, and don't understand why, customizing "entityManager" has not be forked here.. Why that ?
I have several entityManagers and, obviously, the one I have to use for my DataTable is not the one set by default.
Is this a missing ? Does it exist another way (in config.yml for example) to set which entityManger using ?