我想创建多个实体管理器和连接宽度这个方法EntityManager :: create但是如何在创建后获取这个新的实体管理器并使用doctrine来应用不同的命令,如下所示: php bin / console doctrine:database:create --connection = newconnection and $这 - > getDoctrine() - > getManager( 'newconnection');
$isDevMode = false;
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src"), $isDevMode);
$conn = [
'driver' => 'pdo_mysql',
'username' => 'username',
'password' => 'password',
'dbname' => $dbname
];
// obtaining the entity manager
return EntityManager::create($conn, $config);