I am using symfony 4 and I want to access a repository for an entity if I am in the Command class. There is not a function getDoctrine or something..
getDoctrine
I
$kernel = $this->getApplication()->getKernel(); $container = $kernel->getContainer(); // Get doctrine $em = $container->get('doctrine')->getManager();