public function resolveSubMap($registry, $row)
{
$subMap = $this;
if (($disc = $this->getDiscriminator()) !== null) {
$value = $disc->getMapping()->getPropertyValue($registry, $row);
$subMap = $disc->getSubMap((string) $value);
if ($subMap === null) {
$subMap = $this;
} else {
if ($subMap !== $this) {
$subMap = $subMap->resolveSubMap($registry, $row);
}
}
}
return $subMap;
}