How to generate entities from database schema using doctrine-orm-module and zf2

前端 未结 3 561
情深已故
情深已故 2021-01-31 19:15

I am using \"doctrine/doctrine-orm-module\": \"0.7.0\" with ZF2.

Once I create Entities I usually run following commands to sync and generate database automatically acco

3条回答
  •  没有蜡笔的小新
    2021-01-31 19:58

    There's a nice blog written on this here

    Edit: It can be done by using the commands below:
    1. convert-mapping (Table & Entity):

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


    2. Generates getter and setter

       ./vendor/doctrine/doctrine-module/bin/doctrine-module orm:generate-entities ./module/Album/src/ --generate-annotations=true
    

提交回复
热议问题