Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

2.2 addDiscriminatorMapClass fix #327

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).
c3fa29f
Peter Buri
burci commented April 04, 2012

:+1:

László Hornyik
aswyx commented April 04, 2012

:+1:

Benjamin Eberlei beberlei merged commit f628a7f 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).
c3fa29f
This page is out of date. Refresh to see the latest.
2  lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
@@ -1993,7 +1993,7 @@ public function addDiscriminatorMapClass($name, $className)
1993 1993
             if ( ! class_exists($className)) {
1994 1994
                 throw MappingException::invalidClassInDiscriminatorMap($className, $this->name);
1995 1995
             }
1996  
-            if (is_subclass_of($className, $this->name)) {
  1996
+            if (is_subclass_of($className, $this->name) && ! in_array($className, $this->subClasses)) {
1997 1997
                 $this->subClasses[] = $className;
1998 1998
             }
1999 1999
         }
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.