加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-14 04:52:49 所属栏目:百科 来源:网络整理
导读:我正在使用JMSPaymentCoreBundle和JMSPaymentPaypalBundle. 它之前运作良好,但现在我必须更改我的config.yml for new Bundle(FOSMessageBundle) 我必须停止使用’auto_mapping’并使用’entity_managers’代替 doctrine: dbal: orm: auto_generate_proxy_cla
我正在使用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”的文件

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读