I have class ModelsRepository:
class ModelsRepository extends EntityRepository
{}
And service
container_data:
class:
Are you sure that is a good idea to access service from repo?
Repositories are designed for custom SQL where, in case of doctrine, doctrine can help you with find()
,findOne()
,findBy()
, [...] "magic" methods.
Take into account to inject your service where you use your repo and, if you need some parameters, pass it directly to repo's method.