protected function getTypeStringForEntity($class, EntityMap $entityMap)
    {
        $class = $entityMap->getClass();

        $type = array_keys(
            $entityMap->getDiscriminatorColumnMap(),
            $class
        );

        if (count($type) == 0) {
            return $class;
        }

        return $type[0];
    }