Create Doctrine entity of single table from database in Zend Framework 2

僤鯓⒐⒋嵵緔 提交于 2019-12-11 09:58:26

问题


I have configured doctrine ORM in my ZF2 project and create doctrine entity of whole database. Now, I have added one more table named dashboard_group in database. How can I create Doctrine entity for only this table.

I don't want to replace other created entities.


回答1:


Use –filter option in your command :

./vendor//bin/doctrine-module orm:convert-mapping --namespace="YourModule\\Entity\\" --force  --from-database --filter="dashboard_group" annotation ./module/MonModule/src/

And then to add setter/getter into the generated entity :

./vendor/bin/doctrine-module orm:generate-entities ./module/YourModule/src/ --generate-annotations=true --filter="dashboard_group"


来源:https://stackoverflow.com/questions/29538840/create-doctrine-entity-of-single-table-from-database-in-zend-framework-2

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