It is necessary in the project with silex + doctrine2 to separate connections to the database for writing and reading. In the internet there are ways to customize the type:

$app->register(new Silex\Provider\DoctrineServiceProvider(), array( 'dbs.options' => array ( 'mysql_read' => array( 'driver' => 'pdo_mysql', 'host' => 'mysql_read.someplace.tld', 'dbname' => 'my_database', 'user' => 'my_username', 'password' => 'my_password', 'charset' => 'utf8mb4', ), 'mysql_write' => array( 'driver' => 'pdo_mysql', 'host' => 'mysql_write.someplace.tld', 'dbname' => 'my_database', 'user' => 'my_username', 'password' => 'my_password', 'charset' => 'utf8mb4', ), ), )); 

but how to work with ORM is not clear.

    0