我正在使用 JMSPaymentCoreBundle 和 JMSPaymentPaypalBundle。
它以前运行良好,但现在我必须为新的 Bundle(FOSMessageBundle) 更改我的 config.yml
我必须停止使用“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"
关于symfony - 依赖不存在的服务 "doctrine.orm.default_entity_manager",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18816973/