Php 数据库没有任何映射信息Symfony2原则
注意:这不是一个重复的问题,因为我已经尝试了我在谷歌上得到的一切,但没有任何帮助 我正在尝试使用Doctrine反向工程工具导入表,但我收到了以下消息: 数据库没有任何映射信息 Config.yml中的我的连接详细信息Php 数据库没有任何映射信息Symfony2原则,php,symfony,doctrine-orm,doctrine,metadata,Php,Symfony,Doctrine Orm,Doctrine,Metadata,注意:这不是一个重复的问题,因为我已经尝试了我在谷歌上得到的一切,但没有任何帮助 我正在尝试使用Doctrine反向工程工具导入表,但我收到了以下消息: 数据库没有任何映射信息 Config.yml中的我的连接详细信息 doctrine: dbal: default_connection: default connections: default: driver: pdo_mysql
doctrine:
dbal:
default_connection: default
connections:
default:
driver: pdo_mysql
host: localhost
port: null
dbname: pixel_ashish
user: root
password: abc123
charset: UTF8
schema_filter: ~^(?!some_table1|some_table2)~
orm:
default_entity_manager: default
auto_generate_proxy_classes: true
proxy_dir: "%kernel.cache_dir%/doctrine/orm/Proxies"
proxy_namespace: Proxies
resolve_target_entities: []
到目前为止,我所尝试的:
现在我没有主意了,请帮我解决这个问题。您需要在配置中创建一些映射信息 您可以通过在
orm
部分下传递auto_mapping:true
来执行此操作:
doctrine:
orm:
auto_mapping: true
doctrine:
orm:
default_entity_manager: default
entity_managers:
default:
connection: default
mappings:
YourBundleName:
type: "xml"
dir: "Entity"
prefix: "Your\BundleName\Entity"
或者在orm
部分中手动定义:
doctrine:
orm:
auto_mapping: true
doctrine:
orm:
default_entity_manager: default
entity_managers:
default:
connection: default
mappings:
YourBundleName:
type: "xml"
dir: "Entity"
prefix: "Your\BundleName\Entity"
您是否尝试在
orm
部分下添加auto_-mapping:true
?添加auto_-mapping:true,然后在测试之前清除prod或dev的