微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

symfony – 对不存在的服务的依赖“doctrine.orm.default_entity_manager”

我正在使用JMSPaymentCoreBundle和JMSPaymentPaypalBundle.

它之前运作良好,但现在我必须更改我的config.yml for new Bundle(FOSMessageBundle)

我必须停止使用’auto_mapping’并使用’entity_managers’代替

doctrine:
    dbal:

    orm:
        auto_generate_proxy_classes: %kernel.debug%
#       auto_mapping: true
        entity_managers:
            FOSUserBundle: ~
            FOSMessageBundle: ~

但是经过这种改变.

The service "payment.plugin_controller" has a dependency on a non-existent service "doctrine.orm.default_entity_manager"

发生此错误.

我认为config.yml中的更改会导致这种麻烦.

我怎么解决这个问题?

解决方法

根据错误,您需要定义名为default的实体管理器.在您的情况下,整体语法是错误的,请参阅我的示例.

在config.yml中:

doctrine:
    orm:
        entity_managers:
            default: # that's the name of the entity manager
                connection: default # you need to define the default connection
                mappings: 
                    FOSUserBundle: ~
                    FOSMessageBundle: ~

我建议你阅读有关“Databases and Doctrine”“How to work with Multiple Entity Managers and Connections”文件

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐