且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

教义/ Symfony实体生成器和从一个表生成实体

更新时间:2022-02-21 09:04:18

这取决于 / Resources / config / doctrine 目录。如果将其清空并执行您描述的命令,则只会修改 Report 实体。如果您在该目录中拥有所有以前的映射,则还应该修改 User 实体。

It depends on the /Resources/config/doctrine directory. If you empty it out and do the commands you described, then only the Report entity will be modified. If you have all of the previous mappings in that directory it should modify the User entity as well.

命令会自动为您创建实体的备份,因此您将拥有一个新的 User.php 和一个 User.php〜$ c的备份$ c>,如果您使用的是版本控制,并且喜欢 git add src / 而不用太费力地考虑,则应该小心。您不想将这些文件添加到源代码管理中。

The commands will automatically create backups of your entities for you, so you will have a new User.php and a backup in User.php~, which you should be careful of if you are using version control and like to git add src/ without thinking too hard about it. You don't want to add those files to source control.

无论哪种方式,都会创建备份,并且应该在此之上使用版本控制,因此您应该很好。

Either way, backups are created, and you should be using version control on top of that, so you should be fine.