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 according to my entities.
./vendor/bin/doctrine-module orm:validate-schema
./vendor/bin/doctrine-module orm:schema-tool:create
Is there a way to make this process reverse? I mean, Can I generate entities from existing database in mysql?
We use a batch script:
orm:convert-mapping
andorm:generate-entities
is probably what you are looking for.There's a nice blog written on this here
Edit: It can be done by using the commands below:
1. convert-mapping (Table & Entity):
2. Generates getter and setter
Try just it
http://wildlyinaccurate.com/useful-doctrine-2-console-commands/