1
0
mirror of synced 2025-01-17 22:11:41 +03:00

Fixes for multiple connection handling.

This commit is contained in:
Jonathan.Wage 2007-10-05 18:56:36 +00:00
parent 7bbcb51dcf
commit 3b0f749a58

View File

@ -185,17 +185,21 @@ class Doctrine_Import extends Doctrine_Connection_Module
*/
public function importSchema($directory, array $databases = array())
{
$builder = new Doctrine_Import_Builder();
$builder->setTargetPath($directory);
$classes = array();
foreach ($this->listTables() as $table) {
$builder->buildRecord(array('tableName' => $table,
'className' => Doctrine::classify($table)),
$this->listTableColumns($table),
array());
$connections = Doctrine_Manager::getInstance()->getConnections();
$classes[] = Doctrine::classify($table);
foreach ($connections as $connection) {
$builder = new Doctrine_Import_Builder();
$builder->setTargetPath($directory);
$classes = array();
foreach ($connection->import->listTables() as $table) {
$builder->buildRecord(array('tableName' => $table,
'className' => Doctrine::classify($table)),
$connection->import->listTableColumns($table),
array());
$classes[] = Doctrine::classify($table);
}
}
return $classes;