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?

2
  • 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 Commented Dec 12, 2011 at 12:45
  • I was searching for this from 30 minutes than i see this post! Thank you! Commented May 19, 2012 at 17:03

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks but already found the answer 6 months ago ;) (look at the comments)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.