Skip to content

Commit

Permalink
DDC-965 - Defer ID check after loadMetata event is fired.
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Jan 2, 2011
1 parent 1c9007f commit fc16ecc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
Expand Up @@ -284,10 +284,6 @@ protected function loadMetadata($name)
throw MappingException::reflectionFailure($className, $e);
}

// Verify & complete identifier mapping
if ( ! $class->identifier && ! $class->isMappedSuperclass) {
throw MappingException::identifierRequired($className);
}
if ($parent && ! $parent->isMappedSuperclass) {
if ($parent->isIdGeneratorSequence()) {
$class->setSequenceGeneratorDefinition($parent->sequenceGeneratorDefinition);
Expand Down Expand Up @@ -315,6 +311,11 @@ protected function loadMetadata($name)
$this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
}

// Verify & complete identifier mapping
if ( ! $class->identifier && ! $class->isMappedSuperclass) {
throw MappingException::identifierRequired($className);
}

// verify inheritance
if (!$parent && !$class->isMappedSuperclass && !$class->isInheritanceTypeNone()) {
if (count($class->discriminatorMap) == 0) {
Expand Down

0 comments on commit fc16ecc

Please sign in to comment.