Doctrine uses proxy objects to represent related objects in order to facilitate lazy loading. This is a really cool feature, but its causing an issue with something I am trying
This is a little bit nasty workaround that issue :
// $proxyObject = ...
$em->detach($proxyObject);
$entityObject = $em->find(, $proxyObject->getId());
// now you have real entity and not the proxy (entityObject instead of proxyObject)
after that you can replace proxy reference if you need to have it inside other entities