make entities with multiple databases

谁说我不能喝 提交于 2020-01-06 05:03:06

问题


I have to do large refactoring/enhancements on web apps. We decided to use Symfony4.

I want to define 2 (or more) databases: the old one and the new one.
(In the future, I think to have more location, person databases common at several web apps)

In my researches, I use Multiple Entity Managers, create my databases as mentionned, then create my src/Entity/Main and src/Entity/Customer folders.

Then, I want to create my entities, especially new one with php bin/console make:entity but it creates files in Entity folder, not in Entity/Main (default) or Customer and returns

[ERROR] Only annotation mapping is supported by make:entity

Are there any solution to use this make:entity command or should I define all entity files myself?

Nota: I don't put my config/packages/doctrine.yaml, it is the same as in help sample except server_version: '5.6' to be compliant with my MariaDB version


回答1:


The answer to create Product entity in Main is:

php bin/console make:entity Main\\Product

and to create Customer entity in Customer is:

php bin/console make:entity Customer\\Customer


来源:https://stackoverflow.com/questions/53850235/make-entities-with-multiple-databases

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!