错误:无效配置异常:无法识别的选项"auto_mapping"在"doctrine.orm"下
这是我的 config.yml 文件代码
# Doctrine Configuration
doctrine:
dbal:
default_connection: default
connections:
default:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
symfonydb:
driver: pdo_mysql
host: localhost
port: null
dbname: symfony
user: root
password: null
charset: UTF8
# if using pdo_sqlite as your database driver, add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
default_entity_manager: default <<<<<<<<<<
entity_managers:
default:
connection: default
mappings:
AcmeDemoBundle: ~
AcmeUserBundle: ~
symfonydb:
connection: symfonydb
mappings:
FooNewsBundle: ~ <<<<<<<<<
如果我删除 auto_mapping: true 之后的代码,那么它工作正常并且不会引发任何错误。那么问题出在哪里呢?
嗡嗡。
看看这个 GitHub 问题:安装问题?
auto_mapping
条目位于entity_managers.default
节点下,而不是orm
节点的根目录下。