Commit befc0c16 authored by nicobn's avatar nicobn

Builder was broken. Applied patch sent by Carl Michael Skog.

parent e47a72d3
...@@ -116,7 +116,7 @@ END; ...@@ -116,7 +116,7 @@ END;
*/ */
public function buildDefinition($table, $tableColumns) 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; $i = 1;
foreach ($tableColumns as $name => $column) { foreach ($tableColumns as $name => $column) {
...@@ -169,6 +169,10 @@ END; ...@@ -169,6 +169,10 @@ END;
public function buildRecord($table, $tableColumns, $className='', $fileName='') public function buildRecord($table, $tableColumns, $className='', $fileName='')
{ {
if (empty($className)) {
$className = Doctrine::classify($table);
}
if (empty($fileName)) { if (empty($fileName)) {
if (empty($this->path)) { if (empty($this->path)) {
$errMsg = 'No build target directory set.'; $errMsg = 'No build target directory set.';
...@@ -186,10 +190,6 @@ END; ...@@ -186,10 +190,6 @@ END;
$created = date('l dS \of F Y h:i:s A'); $created = date('l dS \of F Y h:i:s A');
if (empty($className)) {
$className = Doctrine::classify($table);
}
$content = sprintf(self::$tpl, $created, $className, $content = sprintf(self::$tpl, $created, $className,
$this->buildDefinition($table, $tableColumns)); $this->buildDefinition($table, $tableColumns));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment