getKernel()->getContainer()->get('doctrine')->getManager($emName); assert($em instanceof EntityManagerInterface); $helperSet = $application->getHelperSet(); $helperSet->set(new EntityManagerHelper($em), 'em'); trigger_deprecation( 'doctrine/doctrine-bundle', '2.7', 'Providing an EntityManager using "%s" is deprecated. Use an instance of "%s" instead.', EntityManagerHelper::class, EntityManagerProvider::class ); } }