final public function getEntityManager(ConfigInterface $config): EntityManagerInterface
    {
        try {
            $dbParams       = $this->getDbConnectionInfo($config);
            $doctrineConfig = $this->getDoctrineConfig($config);
            $this->addDsmParamsToConfig($doctrineConfig, $config);
            $entityManager = $this->createEntityManager($dbParams, $doctrineConfig);
            $this->addEntityFactories($entityManager);
            $this->setDebuggingInfo($config, $entityManager);

            return $entityManager;
        } catch (\Exception $e) {
            $message = 'Exception in ' . __METHOD__ . ': ' . $e->getMessage();

            throw new DoctrineStaticMetaException($message, $e->getCode(), $e);
        }
    }