Symfony 2: Creating a service from a Repository
DEPRECATION WARNING: No more factory_service and factory_method. This is how you should do it since Symfony 2.6 (for Symfony 3.3+ check below): parameters: entity.my_entity: “AppBundle:MyEntity” services: my_entity_repository: class: AppBundle\Repository\MyEntityRepository factory: [“@doctrine”, getRepository] arguments: – %entity.my_entity% The new setFactory() method was introduced in Symfony 2.6. Refer to older versions for the syntax for factories prior to … Read more