mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-483: DiscriminatorMap misbehaves when key are Integer #605
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Mar 30, 2010).
Jira issue originally created by user ulf.thomas:
When in a Class-Inheritance Scenario @DiscriminatorMap is set like "@DiscriminatorMap({2="Class1", 4="Class2"})" (DiscriminatorColumn is of type Integer) then EntityManager->find('Class2', 'key)->will return an object of type Class1.
I hunted down the bug to Doctrine/Common/Annotations/Parser.php (Line: 412):
if (is_string($key)) {
$array[$key] = $value[$key];
} else {
$array[] = $value[$key];
}
should be:
if (is_string($key) || is_int($key)) {
$array[$key] = $value[$key];
} else {
$array[] = $value[$key];
}
@doctrinebot commented on GitHub (Mar 31, 2010):
Comment created by romanb:
Should be fixed now (differently than you suggested though, because that broke other functionality).
@doctrinebot commented on GitHub (Mar 31, 2010):
Issue was closed with resolution "Fixed"