I need to obtain data from two databases in the controller, how to do it?
http://symfony.cn/docs/cookbook/doctrine/multiple_entity_managers.html...
I searched for this answer, but after doing it, it didn't work
習慣沉默2017-05-16 16:46:17
Get database A instance
$emA = $this->get('doctrine')->getManager('default');
Get data B instance
$emB = $this->get('doctrine')->getManager('customer');
Get data from the product entity of the A instance
$productsA = $emA->getRepository('AppBundle:Product')->findAll();
Get data from the product entity of the B instance
$productsB = $emB->getRepository('AppBundle:Product')->findAll();