DDC-752 - Moved verify inheritance block behind the loadMetadata event
This commit is contained in:
parent
c77a12ac83
commit
33d0bb454b
@ -302,16 +302,6 @@ class ClassMetadataFactory
|
|||||||
$this->completeIdGeneratorMapping($class);
|
$this->completeIdGeneratorMapping($class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify inheritance
|
|
||||||
if (!$parent && !$class->isMappedSuperclass && !$class->isInheritanceTypeNone()) {
|
|
||||||
if (count($class->discriminatorMap) == 0) {
|
|
||||||
throw MappingException::missingDiscriminatorMap($class->name);
|
|
||||||
}
|
|
||||||
if (!$class->discriminatorColumn) {
|
|
||||||
throw MappingException::missingDiscriminatorColumn($class->name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($parent && $parent->isInheritanceTypeSingleTable()) {
|
if ($parent && $parent->isInheritanceTypeSingleTable()) {
|
||||||
$class->setPrimaryTable($parent->table);
|
$class->setPrimaryTable($parent->table);
|
||||||
}
|
}
|
||||||
@ -323,6 +313,16 @@ class ClassMetadataFactory
|
|||||||
$this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
|
$this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// verify inheritance
|
||||||
|
if (!$parent && !$class->isMappedSuperclass && !$class->isInheritanceTypeNone()) {
|
||||||
|
if (count($class->discriminatorMap) == 0) {
|
||||||
|
throw MappingException::missingDiscriminatorMap($class->name);
|
||||||
|
}
|
||||||
|
if (!$class->discriminatorColumn) {
|
||||||
|
throw MappingException::missingDiscriminatorColumn($class->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->loadedMetadata[$className] = $class;
|
$this->loadedMetadata[$className] = $class;
|
||||||
|
|
||||||
$parent = $class;
|
$parent = $class;
|
||||||
|
Loading…
Reference in New Issue
Block a user