0

For specific needs, I have to create 2 repositories for the same Entity. The first repository are in the same bundle with the entity and the second, I have to create it in an other bundle but i want to use the same entity with different methodes.

Any idea how can I do that ?

1 Answers1

0

Can't say I see the point, but try this: Symfony 2: Creating a service from a Repository

Create 2 services which extend EntityRepository, construct them correctly and give them the entity reference.

Obviously $em->getRepository('Entity') won't work. But $this->container->get('repository_service_1') will.

Why do you need this?

Community
  • 1
  • 1
Flosculus
  • 6,880
  • 3
  • 18
  • 42