Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

[RFC] EntityContext: Manage multiple connections #222

Open
soullivaneuh opened this issue Jan 20, 2017 · 1 comment
Open

[RFC] EntityContext: Manage multiple connections #222

soullivaneuh opened this issue Jan 20, 2017 · 1 comment

Comments

@soullivaneuh
Copy link

soullivaneuh commented Jan 20, 2017

According to this part of code, it seems you always call the default entity manager for this context.

It would be great to be able to specify which manager to use when we have multiple connections, like this:

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver:   pdo_mysql
                driver_class: AppBundle\DBAL\Driver
                host:     '%database_host%'
                port:     '%database_port%'
                dbname:   '%database_name%'
                user:     '%database_user%'
                password: '%database_password%'
                charset:  UTF8

            powerdns:
                driver:   pdo_mysql
                driver_class: AppBundle\DBAL\Driver
                host:     '%powerdns_host%'
                port:     '%powerdns_port%'
                dbname:   '%powerdns_name%'
                user:     '%powerdns_user%'
                password: '%powerdns_password%'
                charset:  UTF8
        types:
            json: Sonata\Doctrine\Types\JsonType

    orm:
        auto_generate_proxy_classes: '%kernel.debug%'
        default_entity_manager:   default
        entity_managers:
            default:
                connection:           default
                naming_strategy: doctrine.orm.naming_strategy.underscore
                default_repository_class: AppBundle\Repository\DefaultRepository
                mappings:
                    AppBundle: ~
                    FOSUserBundle: ~
                    FOSOAuthServerBundle: ~
            powerdns:
                connection:           powerdns
                naming_strategy: doctrine.orm.naming_strategy.underscore
                default_repository_class: AppBundle\Repository\DefaultRepository
                mappings:
                    PowerDNSBundle: ~
@Nek- Nek- changed the title EntityContext: Manage multiple connections [RFC] EntityContext: Manage multiple connections Mar 17, 2017
@Nek-
Copy link
Contributor

Nek- commented Mar 17, 2017

That would be great. Indeed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants