src/Container.php
public function defineEntityManager(ContainerBuilder $container): void
    {
        $container->getDefinition(EntityManagerInterface::class)
                  ->addArgument(new Reference(Config::class))
                  ->setFactory(
                      [
                          new Reference(EntityManagerFactory::class),
                          'getEntityManager',
                      ]
                  );
    }
public function defineEntityManager(ContainerBuilder $container): void
    {
        $container->getDefinition(EntityManagerInterface::class)
                  ->addArgument(new Reference(Config::class))
                  ->setFactory(
                      [
                          new Reference(EntityManagerFactory::class),
                          'getEntityManager',
                      ]
                  );
    }
public function defineEntityManager ( ContainerBuilder $ container ) : void { $ container -> getDefinition ( EntityManagerInterface :: class ) -> addArgument ( new Reference ( Config :: class ) ) -> setFactory ( [ new Reference ( EntityManagerFactory :: class ) , 'getEntityManager' , ] ) ; }
This is used to auto wire the entity manager. It first adds the DSM factory as the factory for the class, and
sets the Entity Manager as the implementation of the interface. Overrider this if you want to use your own
factory to create and configure the entity manager

@param ContainerBuilder $container
This is used to auto wire the entity manager . It first adds the DSM factory as the factory for the class and sets the Entity Manager as the implementation of the interface . Overrider this if you want to use your own factory to create and configure the entity manager