Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

addDiscriminatorMapClass fix #328

Merged
merged 1 commit into from

4 participants

Mátyás Somfai Peter Buri László Hornyik Benjamin Eberlei
Mátyás Somfai

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

http://www.doctrine-project.org/jira/browse/DDC-1763

Mátyás Somfai smatyas Fixing a bug when calling setDiscriminatorMap from multiple sources (…
…ie: from Events::loadClassMetadata and annotation).
a2fd4ec
Benjamin Eberlei beberlei merged commit a1a9f85 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 4, 2012
  1. Mátyás Somfai

    Fixing a bug when calling setDiscriminatorMap from multiple sources (…

    smatyas authored
    …ie: from Events::loadClassMetadata and annotation).
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
2  lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
View
@@ -2044,7 +2044,7 @@ public function addDiscriminatorMapClass($name, $className)
if ( ! class_exists($className)) {
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;
}
}
Something went wrong with that request. Please try again.