Config::$db_driver, 'user' => Config::$user, 'password' => Config::$password, 'host' => Config::$db_host, 'dbname' => Config::$database, ], $config); // obtaining the entity manager $entityManager = new EntityManager($connection, $config); foreach($entityManager->getMetadataFactory()->getAllMetadata() as $class){}