Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

addDiscriminatorMapClass fix #328

Merged
merged 1 commit into from about 2 years ago

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 Fixing a bug when calling setDiscriminatorMap from multiple sources (…
…ie: from Events::loadClassMetadata and annotation).
a2fd4ec
Peter Buri
burci commented April 04, 2012

:+1:

László Hornyik
aswyx commented April 04, 2012

:+1:

Benjamin Eberlei beberlei merged commit a1a9f85 into from April 07, 2012
Benjamin Eberlei beberlei closed this April 07, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 04, 2012
Mátyás Somfai Fixing a bug when calling setDiscriminatorMap from multiple sources (…
…ie: from Events::loadClassMetadata and annotation).
a2fd4ec
This page is out of date. Refresh to see the latest.
2  lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
@@ -2044,7 +2044,7 @@ public function addDiscriminatorMapClass($name, $className)
2044 2044
             if ( ! class_exists($className)) {
2045 2045
                 throw MappingException::invalidClassInDiscriminatorMap($className, $this->name);
2046 2046
             }
2047  
-            if (is_subclass_of($className, $this->name)) {
  2047
+            if (is_subclass_of($className, $this->name) && ! in_array($className, $this->subClasses)) {
2048 2048
                 $this->subClasses[] = $className;
2049 2049
             }
2050 2050
         }
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.