I am using Zend 1.11 with Doctrine 1.1.4. My application uses multiple databases.
In my bootstrap.php file, I've set up the details for two databases;
$dbs = array(
'global_users'=>array(
'adapter' => 'mysqli',
'params' => array(
'host' => 'localhost',
'username' => 'root',
'password' => '',
'dbname' => 'global_users',
'charset' => 'UTF8',
),
),
'search_landscape'=>array(
'adapter' => 'mysqli',
'params' => array(
'host' => 'localhost',
'username' => 'root',
'password' => '',
'dbname' => 'search_landscape',
'charset' => 'UTF8',
),
),
);
I've generated the Doctrine Model classes for the second database, search_landscape. I have not used the global_users database yet in the application whilst I have performed several Doctrine queries on the second database, search_landscape which is working as expected so far.
When performing the Doctrine queries, I am not defining an explicit connection to the database i.e it using the default connection, how does Doctrine know which database to connect to?
When I start to use the other databases in the application I understand I'll have to define the Doctrine connection for each of them explicitly, however right now I have not defined any explicit connections yet Doctrine seems to know which db to connect to out of the two.
Appreciate the help.