src/Database/EntityAbstract.php
private static function configEntityManager()
    {
        if (self::$entityManager) {
            return;
        }

        $isDevMode = cfg::htrFileConfigs()->devmode ?? false;
        $paths = [cfg::baseDir() . cfg::PATH_ENTITIES];

        // the connection configuration
        if ($isDevMode) {
            $dbParams = cfg::DATABASE_CONFIGS_DEV;
        } else {
            $dbParams = cfg::DATABASE_CONFIGS_PRD;
        }

        $cache = new ArrayCache();
        $reader = new AnnotationReader();
        $driver = new AnnotationDriver($reader, $paths);

        $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
        $config->setMetadataCacheImpl($cache);
        $config->setQueryCacheImpl($cache);
        $config->setMetadataDriverImpl($driver);

        self::$entityManager = EntityManager::create($dbParams, $config);
    }
private static function configEntityManager()
    {
        if (self::$entityManager) {
            return;
        }

        $isDevMode = cfg::htrFileConfigs()->devmode ?? false;
        $paths = [cfg::baseDir() . cfg::PATH_ENTITIES];

        // the connection configuration
        if ($isDevMode) {
            $dbParams = cfg::DATABASE_CONFIGS_DEV;
        } else {
            $dbParams = cfg::DATABASE_CONFIGS_PRD;
        }

        $cache = new ArrayCache();
        $reader = new AnnotationReader();
        $driver = new AnnotationDriver($reader, $paths);

        $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
        $config->setMetadataCacheImpl($cache);
        $config->setQueryCacheImpl($cache);
        $config->setMetadataDriverImpl($driver);

        self::$entityManager = EntityManager::create($dbParams, $config);
    }
private static function configEntityManager ( ) { if ( self :: $ entityManager ) { return ; } $ isDevMode = cfg :: htrFileConfigs ( ) -> devmode ?? false ; $ paths = [ cfg :: baseDir ( ) . cfg :: PATH_ENTITIES ] ; // the connection configuration if ( $ isDevMode ) { $ dbParams = cfg :: DATABASE_CONFIGS_DEV ; } else { $ dbParams = cfg :: DATABASE_CONFIGS_PRD ; } $ cache = new ArrayCache ( ) ; $ reader = new AnnotationReader ( ) ; $ driver = new AnnotationDriver ( $ reader , $ paths ) ; $ config = Setup :: createAnnotationMetadataConfiguration ( $ paths , $ isDevMode ) ; $ config -> setMetadataCacheImpl ( $ cache ) ; $ config -> setQueryCacheImpl ( $ cache ) ; $ config -> setMetadataDriverImpl ( $ driver ) ; self :: $ entityManager = EntityManager :: create ( $ dbParams , $ config ) ; }
Config the Entity Manager of Doctrine

@author Edson B S Monteiro <bruno.monteirodg@gmail.com>
@since 1.0
Config the Entity Manager of Doctrine