I suppose the answer is no but I am asking to be sure. SensioGeneratorBundle contains a command to generate entities. Do you know if it can generate the mappings for a one2Many or Many2Many field? Is there any project that implements this?
The only example I found:
php app/console doctrine:generate:entity --entity=AcmeBlogBundle:Blog/Post --format=annotation --fields="title:string(255) body:text" --with-repository --no-interaction
Many thanks
There is a workaround that makes the job perfectly, without any additional software or bundle to install.
You just have to edit the DatabaseDriver.php
from doctrine like described here :
Symfony2 Doctrine2 - generate One-To-Many annotation from existing database by doctrine:mapping:import
I know this is old... but this could help some people.
Here is a Symfony3 bundle that can generate Doctrine 2 associations, including a one-to-many relationship:
https://github.com/Remg/GeneratorBundle
Associations
- Handles all Doctrine2 association types (OneToOne, OneToMany, ManyToOne, ManyToMany).
- Handles unidirectional and bidirectional associations.
AFAIK the answer is no. I have already asked a similar question and it seems that there is no free tool that can do that. But if you want to pay : http://www.orm-designer.com/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With