Create Doctrine entity of single table from databa

2019-07-30 11:25发布

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条回答
Evening l夕情丶
2楼-- · 2019-07-30 12:03

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"
查看更多
登录 后发表回答