From 4603e94fe990e1063f4a2d6ccc87247e3bc3935b Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Thu, 30 Jun 2011 15:04:57 -0300 Subject: [PATCH] Fixed ClassMetadataFactory which was throwing an exception if parent class on inheritance hierarchy is an abstract class and also extends from a mapped superclass (so it contains an inheritance already), but is not in the discriminatorMap. --- lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index 3f65da3c5..8bfda6450 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -327,7 +327,7 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface if (!$class->discriminatorColumn) { throw MappingException::missingDiscriminatorColumn($class->name); } - } else if ($parent && !in_array($class->name, array_values($class->discriminatorMap))) { + } else if ($parent && !$class->reflClass->isAbstract() && !in_array($class->name, array_values($class->discriminatorMap))) { // enforce discriminator map for all entities of an inheritance hierachy, otherwise problems will occur. throw MappingException::mappedClassNotPartOfDiscriminatorMap($class->name, $class->rootEntityName); }