diff --git a/lib/Doctrine/Import.php b/lib/Doctrine/Import.php index b6771088b..0059aed64 100644 --- a/lib/Doctrine/Import.php +++ b/lib/Doctrine/Import.php @@ -192,7 +192,8 @@ class Doctrine_Import extends Doctrine_Connection_Module foreach ($this->listTables() as $table) { $builder->buildRecord(array('tableName' => $table, 'className' => Doctrine::classify($table)), - $this->listTableColumns($table)); + $this->listTableColumns($table), + array()); $classes[] = Doctrine::classify($table); } diff --git a/lib/Doctrine/Import/Builder.php b/lib/Doctrine/Import/Builder.php index 8848dd999..294d49795 100644 --- a/lib/Doctrine/Import/Builder.php +++ b/lib/Doctrine/Import/Builder.php @@ -224,9 +224,13 @@ END; return $content; } - public function buildRecord($table, $columns, $relations) + public function buildRecord($options, $columns, $relations) { - if (empty($fileName)) { + if ( ! isset($options['className'])) { + throw new Doctrine_Import_Builder_Exception('Missing class name.'); + } + + if ( ! isset($options['fileName'])) { if (empty($this->path)) { $errMsg = 'No build target directory set.'; throw new Doctrine_Import_Builder_Exception($errMsg); @@ -238,15 +242,15 @@ END; throw new Doctrine_Import_Builder_Exception($errMsg); } - $fileName = $this->path . DIRECTORY_SEPARATOR . $className . $this->suffix; + $options['fileName'] = $this->path . DIRECTORY_SEPARATOR . $options['className'] . $this->suffix; } $content = $this->buildDefinition($options, $columns, $relations); - $bytes = file_put_contents($fileName, '