Is there a simple way to inject a dependency into every repository instance in Doctrine2 ?
I have tried listening to the loadClassMetadata event and usi
loadClassMetadata
You can actually create your own DefaultRepository extends EntityRepository, construct it with all dependencies you need and then set it as a default Repository with:
DefaultRepository extends EntityRepository
Repository
doctrine: orm: entity_managers: default: default_repository_class: AppBundle\ORM\DefaultRepository