1
0
mirror of synced 2024-12-14 07:06:04 +03:00

severe export bug fix: classes using column aggregation inheritance not properly exported

This commit is contained in:
zYne 2007-09-01 16:11:58 +00:00
parent 5d1d506a3a
commit 07b5727c52

View File

@ -1042,8 +1042,20 @@ class Doctrine_Export extends Doctrine_Connection_Module
// 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)
if ($class->isSubclassOf($parent) && ! $class->isAbstract() && $class->hasMethod('setTableDefinition')
&& $class->getMethod('setTableDefinition')->getDeclaringClass()->getName() == $class->getName()) {
// we have to recursively iterate through the class parents just to be sure that the classes using for example
// column aggregation inheritance are properly exporterd to database
while ($class->isAbstract() &&
! $class->isSubclassOf($parent) &&
! $class->hasMethod('setTableDefinition') &&
$class->getMethod('setTableDefinition')->getDeclaringClass()->getName() !== $class->getName()) {
$class = $class->getParent();
if ($class === null) {
break;
}
}
$record = new $name();
$table = $record->getTable();
$data = $table->getExportableFormat();
@ -1056,7 +1068,6 @@ class Doctrine_Export extends Doctrine_Connection_Module
$sql[] = $query;
}
}
}
$sql = array_unique($sql);
rsort($sql);