DDC-868 - Fix bug where a ClassMetadata instance from a STI child level is processed before the parent.
This commit is contained in:
parent
a966cb6cc7
commit
53e8b8f32d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user