I've seen a huge amount of projects that uses doctrine and some of them inject the container or other services inside a repository. I've seen also some questions here that talk about container inside a repository:
I got only problem adding container o other services to a repository or an entity. I think there could be some side effects. For example I cannot reuse some code if it depends on a service that is not available in a particular context. For example if my repository depends on Symfony\Component\HttpFoundation\Request
it cannot be used inside a command.
Can be a better solution the creation of a service instead of a coupled repository?