Can Symfony2 generate:doctrine:entity generate entity with one-to-many relationship?

database, doctrine-orm, php, symfony

Solution

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.

Problem

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

Original source