Fixes for multiple connection handling.
This commit is contained in:
parent
7bbcb51dcf
commit
3b0f749a58
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user