4

Here is my config file:

# Doctrine Configuration
doctrine:
    dbal:
        default_connection: flux
        connections:
            flux:
                driver:   %db_flux_driver%
                host:     %db_flux_host%
                port:     %db_flux_port%
                dbname:   %db_flux_name%
                user:     %db_flux_user%
                password: %db_flux_password%
                charset:  UTF8
            commun:
                driver:   %db_commun_driver%
                host:     %db_commun_host%
                port:     %db_commun_port%
                dbname:   %db_commun_name%
                user:     %db_commun_user%
                password: %db_commun_password%
                charset:  UTF8
    orm:
        default_entity_manager: default
        entity_managers:
            default:
                connection: flux
                mappings:
                    CreatisSaisieBundle: ~
            commun:
                connection: commun
                mappings:
                    CreatisSaisieBundle: ~

As you can see I'm using 2 connections.

I've been using the app/console doctrine:mapping:convert xml command line to generate my orm xml files but that only generated the entities from my default connection (flux).

Is there an option that allows to generate entities from a specific connection, or from all of them?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Yoot
  • 657
  • 2
  • 14
  • 26
  • 2
    Ok for those who have the same problem : php app/console doctrine:mapping:convert yml ./src/MyCo/Base/ MyBundle/Resources/config/doctrine/metadata/orm --from-database --force **--em=commun** – Yoot Dec 12 '11 at 12:45
  • I was searching for this from 30 minutes than i see this post! Thank you! – flower58 May 19 '12 at 17:03

1 Answers1

2

I've test this command to create entity for my app, it seems to work:

php app/console doctrine:mapping:convert --em="ENTITY_MANAGER" --from-database yml ./src/NAMESPACE/NAMEBundle/Resources/config/doctrine/metadata/orm
malenkiy_scot
  • 16,415
  • 6
  • 64
  • 87
le_yougue
  • 36
  • 2