get(EnvironmentHandler::class); $config = ORMSetup::createAttributeMetadataConfiguration( paths: [ Paths::PHP_SOURCE_PATH . '/Entities' ], isDevMode: !$environmentHandler->isProduction() ); $dbEnvironment = $environmentHandler->getDatabaseEnvironment(); $connection = DriverManager::getConnection($dbEnvironment->getDoctrineConfig()); $entityManager = new EntityManager($connection, $config); $container->addShared(EntityManager::class, $entityManager); $container->addShared(EntityManagerInterface::class, $entityManager); $container->addShared(Connection::class, $connection); } }