From befc0c16b01daa061e77a01261fee66563e9d3ae Mon Sep 17 00:00:00 2001 From: nicobn Date: Tue, 10 Jul 2007 15:20:13 +0000 Subject: [PATCH] Builder was broken. Applied patch sent by Carl Michael Skog. --- lib/Doctrine/Import/Builder.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/Import/Builder.php b/lib/Doctrine/Import/Builder.php index 05443235b..3f8da7c6d 100644 --- a/lib/Doctrine/Import/Builder.php +++ b/lib/Doctrine/Import/Builder.php @@ -116,7 +116,7 @@ END; */ public function buildDefinition($table, $tableColumns) { - $columns = array(0 => str_repeat(' ', 8) . '$this->setTableName(\'$table\');'); + $columns = array(0 => str_repeat(' ', 8) . '$this->setTableName(\''. $table .'\');'); $i = 1; foreach ($tableColumns as $name => $column) { @@ -169,6 +169,10 @@ END; public function buildRecord($table, $tableColumns, $className='', $fileName='') { + if (empty($className)) { + $className = Doctrine::classify($table); + } + if (empty($fileName)) { if (empty($this->path)) { $errMsg = 'No build target directory set.'; @@ -186,10 +190,6 @@ END; $created = date('l dS \of F Y h:i:s A'); - if (empty($className)) { - $className = Doctrine::classify($table); - } - $content = sprintf(self::$tpl, $created, $className, $this->buildDefinition($table, $tableColumns));