Hello i'm using Zend Framework 2 and DoctrineORMModule. I need to access to different data bases connections and map two different set of schemas.
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDODblib\Driver',
'params' => array(
'host' => 'HOST',
'port' => '1433',
'user' => 'USER',
'password' => 'PASS',
'dbname' => 'DBNAME',
)
)
)
),
/////////////
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => '127.0.0.1',
'port' => '3306',
'user' => 'root',
'password' => 'root',
'dbname' => 'test',
)
)
),
),
I found this in the documentation: https://github.com/doctrine/DoctrineORMModule/blob/master/docs/configuration.md#how-to-use-two-connections But it is not very descriptive.
Can anyone help me?
How to used:
Have a look at link and link. Unfortunately the use statements seems to be missing. These are the factories with FQDN:
If you only want to access another database (on the same server, same user, etc.), you can easily define your tables in the entities like this:
and save yourself a lot of trouble.
U can set this array config for every separate module in your module config file