Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

addDiscriminatorMapClass fix #328

Merged
merged 1 commit into from

4 participants

@smatyas

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

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

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

    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
View
2  lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
@@ -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.