Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

2.1.x setDiscriminatorMap fix #326

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

:+1:

László Hornyik
aswyx commented April 04, 2012

:+1:

Benjamin Eberlei beberlei merged commit 57accea 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).
7d3fee5
This page is out of date. Refresh to see the latest.
2  lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
@@ -1642,7 +1642,7 @@ public function setDiscriminatorMap(array $map)
1642 1642
                 if ( ! class_exists($className)) {
1643 1643
                     throw MappingException::invalidClassInDiscriminatorMap($className, $this->name);
1644 1644
                 }
1645  
-                if (is_subclass_of($className, $this->name)) {
  1645
+                if (is_subclass_of($className, $this->name) && ! in_array($className, $this->subClasses)) {
1646 1646
                     $this->subClasses[] = $className;
1647 1647
                 }
1648 1648
             }
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.