Commit 91cb642d authored by Jonathan.Wage's avatar Jonathan.Wage

Moved loadTemplate() and actAs() generating to the setUp() method

parent de165179
......@@ -329,7 +329,7 @@ END;
* @param string $table
* @param array $tableColumns
*/
public function buildTableDefinition(array $options, array $columns, array $relations, array $indexes, array $attributes, array $templates, array $actAs, array $tableOptions)
public function buildTableDefinition(array $options, array $columns, array $relations, array $indexes, array $attributes, array $tableOptions)
{
$ret = array();
......@@ -379,12 +379,6 @@ END;
$ret[$i] = $this->buildAttributes($attributes);
$i++;
$ret[$i] = $this->buildTemplates($templates);
$i++;
$ret[$i] = $this->buildActAs($actAs);
$i++;
$ret[$i] = $this->buildTableOptions($tableOptions);
$code = implode("\n", $ret);
......@@ -525,7 +519,7 @@ END;
* @param array $relations
* @return string
*/
public function buildSetUp(array $options, array $columns, array $relations)
public function buildSetUp(array $options, array $columns, array $relations, array $templates, array $actAs)
{
$ret = array();
$i = 0;
......@@ -595,6 +589,12 @@ END;
$ret[$i] = " ".'$this->setInheritanceMap(array(\''.$options['inheritance']['keyField'].'\' => \''.$options['inheritance']['keyValue'].'\'));';
}
$ret[$i] = $this->buildTemplates($templates);
$i++;
$ret[$i] = $this->buildActAs($actAs);
$i++;
$code = implode("\n", $ret);
$code = trim($code);
......@@ -626,8 +626,8 @@ END;
$extends = isset($options['inheritance']['extends']) ? $options['inheritance']['extends']:$this->_baseClassName;
if ( ! (isset($options['no_definition']) && $options['no_definition'] === true)) {
$definition = $this->buildTableDefinition($options, $columns, $relations, $indexes, $attributes, $templates, $actAs, $tableOptions);
$setUp = $this->buildSetUp($options, $columns, $relations);
$definition = $this->buildTableDefinition($options, $columns, $relations, $indexes, $attributes, $tableOptions);
$setUp = $this->buildSetUp($options, $columns, $relations, $templates, $actAs);
} else {
$definition = null;
$setUp = null;
......
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