1
0
mirror of synced 2025-01-18 06:21:40 +03:00

DDC-868 - Fix bug where a ClassMetadata instance from a STI child level is processed before the parent.

This commit is contained in:
Benjamin Eberlei 2010-11-09 22:13:35 +01:00
parent a966cb6cc7
commit 53e8b8f32d

View File

@ -92,6 +92,22 @@ class SchemaTool
return $schema->toSql($this->_platform);
}
/**
* Some instances of ClassMetadata don't need to be processed in the SchemaTool context. This method detects them.
*
* @param ClassMetadata $class
* @param array $processedClasses
* @return bool
*/
private function processingNotRequired($class, array $processedClasses)
{
return (
isset($processedClasses[$class->name]) ||
$class->isMappedSuperclass ||
($class->isInheritanceTypeSingleTable() && $class->name != $class->rootEntityName)
);
}
/**
* From a given set of metadata classes this method creates a Schema instance.
*
@ -110,7 +126,7 @@ class SchemaTool
$evm = $this->_em->getEventManager();
foreach ($classes as $class) {
if (isset($processedClasses[$class->name]) || $class->isMappedSuperclass) {
if ($this->processingNotRequired($class, $processedClasses)) {
continue;
}