链配置了具有两个ORM EntityManagers的命名空间

时间:2017-08-25 11:46:05

标签: php symfony fosuserbundle symfony-2.7 bundles

我尝试使用两个bundle / db-connection创建一个应用程序(每个db一个)。 DB-Connect工作正常(尝试使用php app / console doctrine:query:sql --connection master / default)。 但我总是得到错误:

MappingException in MappingException.php line 37:
The class 'PortalBundle\Entity\User' was not found in the chain configured 
namespaces FOS\UserBundle\Entity.

任何提示?

配置:

doctrine:
    dbal:
        default_connection: default

        connections:
          default:
                  ....
          master: 
                  ....
    orm:
        default_entity_manager: default
        auto_generate_proxy_classes: false
        entity_managers:
            default:
                connection: default
                naming_strategy: doctrine.orm.naming_strategy.underscore
                auto_mapping: true
            master:
                connection: master
                naming_strategy: doctrine.orm.naming_strategy.underscore
                mappings:
                    PortalBundle: ~
                    MasterBundle: ~

fos_user:
    db_driver:  orm
    firewall_name:  main
    model_manager_name: default
    user_class: PortalBundle\Entity\User
    group:
        group_class:  PortalBundle\Entity\UserGroup

0 个答案:

没有答案