Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Commit

Permalink
Update ModelGenerator.php
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkSide666 committed Mar 2, 2013
1 parent 8e6f562 commit 6b55c43
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mvc/Page/ModelGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,13 @@ function resolveFieldName($field){
return $field->name();
}
function findModels($dir=null, &$models=null, $prefix = null){
$r = $this->api->db->getAll("show tables");
$r = $this->api->db->dsql()->expr('show tables')->get();
$tables = array();
foreach ($r as $row){
$tables[] = $row[0];
}
if ($tables){
foreach ($tables as $table){
$fields[$table] = $this->api->db->getAllHash("desc `$table`");
}
foreach ($tables as $table){
$fields[$table] = $this->api->db->dsql()->expr("desc `$table`")->get();
}
return array($tables, $fields);
}
Expand Down

0 comments on commit 6b55c43

Please sign in to comment.