Mirage
Mirage

Reputation: 31548

Under what conditions i will need more entity managers in symfony2 Doctrine2

I have been using symfony2 and doctrine2. I am working with one entity manager.

I am still not able to find why would there be need of more entity managers in project.

Can anyone please explain me what is the use case of having more entity managers

Upvotes: 2

Views: 216

Answers (2)

Layton Everson
Layton Everson

Reputation: 1148

You can use multiple entity managers in a Symfony2 application. This is necessary if you are using different databases or even vendors with entirely different sets of entities. In other words, one entity manager that connects to one database will handle some entities while another entity manager that connects to another database might handle the rest.

http://symfony.com/doc/current/cookbook/doctrine/multiple_entity_managers.html

Upvotes: 5

Florent
Florent

Reputation: 12420

You need more than one entity manager if you want to connect to multiple databases.

Moreover, if you want to use Doctrine PHPCR or Doctrine OXM, you have to use their respective entity manager.

Upvotes: 1

Related Questions