1
0
mirror of synced 2024-12-14 15:16:04 +03:00

Fixing a bug when calling setDiscriminatorMap from multiple sources (ie: from Events::loadClassMetadata and annotation).

This commit is contained in:
Somfai Mátyás 2012-04-04 14:47:42 +02:00
parent 5b18718b92
commit a2fd4eca37

View File

@ -2044,7 +2044,7 @@ class ClassMetadataInfo implements ClassMetadata
if ( ! class_exists($className)) { if ( ! class_exists($className)) {
throw MappingException::invalidClassInDiscriminatorMap($className, $this->name); throw MappingException::invalidClassInDiscriminatorMap($className, $this->name);
} }
if (is_subclass_of($className, $this->name)) { if (is_subclass_of($className, $this->name) && ! in_array($className, $this->subClasses)) {
$this->subClasses[] = $className; $this->subClasses[] = $className;
} }
} }