<?php


namespace AutoAdmin\Bundle\Core\Helper;


class DoctrineHelper
{
    const PROXY_PREFIX = 'Proxies\\__CG__\\';

    public static function getClass(object $object)
    {
        return self::removeProxyPrefix(get_class($object));
    }

    public static function removeProxyPrefix(string $fqcn)
    {
        if (strpos($fqcn, self::PROXY_PREFIX) === 0) {
            $fqcn = str_replace(self::PROXY_PREFIX, '', $fqcn);
        }

        return $fqcn;
    }
}