Commit 8e57185e authored by Jonathan.Wage's avatar Jonathan.Wage

Fixes.

parent 122ebf0c
......@@ -124,8 +124,7 @@ abstract class Doctrine_Export_Schema
// and currently declared classes
foreach ($tables as $name) {
$class = new ReflectionClass($name);
$conn = Doctrine_Manager::getInstance()->getConnectionForComponent($name);
// check if class is an instance of Doctrine_Record and not abstract
// class must have method setTableDefinition (to avoid non-Record subclasses like symfony's sfDoctrineRecord)
// we have to recursively iterate through the class parents just to be sure that the classes using for example
......@@ -154,6 +153,12 @@ abstract class Doctrine_Export_Schema
$table = array();
$table['name'] = $data['tableName'];
$table['class'] = get_class($record);
foreach ($data['columns'] AS $name => $column)
{
$data['columns'][$name]['name'] = $name;
}
$table['columns'] = $data['columns'];
$array['tables'][$data['tableName']] = $table;
......
<?xml version="1.0" encoding="ISO-8859-1" ?>
<schema>
<tables>
<table>
<user>
<name>user</name>
<class>User</class>
<columns>
......@@ -18,9 +18,9 @@
<notnull>true</notnull>
</column>
</columns>
</table>
</user>
<table>
<group>
<name>group</name>
<class>Group</class>
<columns>
......@@ -37,6 +37,6 @@
<notnull>true</notnull>
</column>
</columns>
</table>
</group>
</tables>
</schema>
\ No newline at end of file
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