Skip to content

Commit

Permalink
fix create table entity issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hws47a committed Apr 13, 2013
1 parent fd800c4 commit 655745f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Mtool/Codegen/Entity/TableEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,17 @@ public function create($namespace, $path, Mtool_Codegen_Entity_Module $module, $

//Create resource model namespace in config if not exist
$configPath = "global/{$this->_configNamespace}/{$namespace}/resourceModel";
if (!$config->get($configPath)) {
$config->set($configPath, "{$namespace}_resource");
$resourceNamespace = $config->get($configPath);
if (!$resourceNamespace) {
$resourceNamespace = "{$namespace}_resource";
$config->set($configPath, $resourceNamespace);
}
$resourceConfigPath = "global/{$this->_configNamespace}/{$namespace}_resource/class";
$resourceConfigPath = "global/{$this->_configNamespace}/{$resourceNamespace}/class";
if (!$config->get($resourceConfigPath)) {
$config->set($resourceConfigPath, "{$module->getName()}_{$this->_entityName}_Resource");
}

//Create table entity
$resourceNamespace = $config->get($configPath);
$configPath = "global/{$this->_configNamespace}/{$resourceNamespace}/entities/{$entityName}/table";
$config->set($configPath, $tableName);

Expand Down

0 comments on commit 655745f

Please sign in to comment.