private function getEntityNamespace(EntityInterface $entity): string
    {
        if ($entity instanceof Proxy) {
            $proxyFqn  = \get_class($entity);
            $namespace = $this->entityManager->getConfiguration()->getProxyNamespace();
            $marker    = \Doctrine\Common\Persistence\Proxy::MARKER;

            return str_replace($namespace . '\\' . $marker . '\\', '', $proxyFqn);
        }

        return $this->namespaceHelper->getObjectFqn($entity);
    }