public function getTablesFromZendDb($db) { $table_list = $db->listTables(); foreach ($table_list as $table_name) { $table = new Table($table_name); $this->_tables[$table_name] = $table; $column_list = $db->describeTable($table_name); foreach ($column_list as $column_name => $attributes) { if ($attributes['PRIMARY']) { $table->setPrimaryKey($column_name); } $table->addColumn(new Column($column_name)); } } return $this; }