Fix: handle invalid discriminator value
This commit is contained in:
parent
f7b95c1aa5
commit
d1c722c1d0
1 changed files with 7 additions and 1 deletions
|
@ -98,7 +98,13 @@ class SimpleObjectHydrator extends AbstractHydrator
|
||||||
throw HydrationException::emptyDiscriminatorValue(key($this->_rsm->aliasMap));
|
throw HydrationException::emptyDiscriminatorValue(key($this->_rsm->aliasMap));
|
||||||
}
|
}
|
||||||
|
|
||||||
$entityName = $this->class->discriminatorMap[$sqlResult[$discrColumnName]];
|
$discrMap = $this->class->discriminatorMap;
|
||||||
|
|
||||||
|
if ( ! isset($discrMap[$sqlResult[$discrColumnName]])) {
|
||||||
|
throw HydrationException::invalidDiscriminatorValue($sqlResult[$discrColumnName], array_keys($discrMap));
|
||||||
|
}
|
||||||
|
|
||||||
|
$entityName = $discrMap[$sqlResult[$discrColumnName]];
|
||||||
|
|
||||||
unset($sqlResult[$discrColumnName]);
|
unset($sqlResult[$discrColumnName]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue