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
If you first used $em->getReference and then $em->find, then the result will be a _proxy. I recommend using:
$em->getReference
$em->find
createQueryBuilder ... ->getQuery() ->setHint (Query::HINT_FORCE_PARTIAL_LOAD, true) ->getOneOrNullResult();