private function isPolymorphicType(ClassMetadataInfo $metadata)
    {
        return in_array($metadata->inheritanceType, $this->getPolymorphicTypes()) && null === $metadata->discriminatorValue;
    }