简体   繁体   English

如何覆盖学说中的现有实体?

[英]how to overwrite existing entities in doctrine?

I am trying to run the command doctrine command for entities: 我正在尝试为实体运行命令doctrine命令:

./vendor/bin/doctrine orm:convert-mapping  --from-database annotation ./Models

First time I run this command for generating entity mapping files then I modify the database table and again run the same command and got this error: 我第一次运行此命令来生成实体映射文件然后我修改数据库表并再次运行相同的命令并得到此错误:

In ExportException.php line 36:

  Attempting to overwrite an existing file 'D:\xampp\htdocs\docx\Models\Address.php'.


orm:convert-mapping [--filter FILTER] [-f|--force] [--from-database] [--extend [EXTEND]] [--num-spaces [NUM-SPACES]] [--namespace [NAMESPACE]] [--] <to-type> <dest-path>

You have to use switch -f or --force try this : 你必须使用switch -f或--force试试这个:

$ ./vendor/bin/doctrine orm:convert-mapping  --from-database --force annotation ./Models

and then regenerate entities 然后重新生成实体

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM