Can you move that to Doctrine\ORM\Cache\Persiters\EntityPersister instead?