Query
$em->getRepository($this->getRepositoryName(\'AppBundle:User\'))->find($id);
return object instance of Proxies\\__CG__\\A
Sometimes we need to respectively determine real class name for an Entity.
Doctrine uses static methods, placed in a helper class: 'Doctrine\Common\Util\ClassUtils', for generating name of proxy class. Here is description: Class ClassUtils.
In case you want to get a real class name, just use:
$entityClassName = ClassUtils::getClass($entityObject);
.
I've found this useful for logging of entity data changes (original entity can be determined by id
and class name
).
Hope it was helpfull.