In case of ManyToOne/OneToMany if NONE of joined coloumns are primary it throws a proxy notice:
NOTICE: Undefined index: id in /vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 121
Can be replicated this by running:
$somethings = $em->getRepository('Entities\Something')->findBy(array('productId' => "4"));
Something entity is ManyToOne to another OneToMany entity, and this productId is primary on NONE of these two entities/tables.