这是我的配置文件:

# 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: ~

如您所见,我正在使用2个连接。

我一直在使用app / console doctrine:mapping:convert xml命令行来生成我的orm xml文件,但这仅从默认连接(通量)生成了实体。

是否有允许从特定连接或从所有连接生成实体的选项?

===============>>#1 票数:2 已采纳

我已经测试了此命令来为我的应用创建实体,它似乎可以正常工作:

php app/console doctrine:mapping:convert --em="ENTITY_MANAGER" --from-database yml ./src/NAMESPACE/NAMEBundle/Resources/config/doctrine/metadata/orm

  ask by Yoot translate from so

未解决问题?本站智能推荐: