Handle Doctrine proxies correctly in PagerfantaHandler