When using generateModelsFromDb to generate the models Doctrine makes one to many relations between the relation table and the base tables instead of generating a nm-relation between the base tables themselves. Is there any way to let generateModelsFromDb detect the n-m relation?
When using generateModelsFromDb to generate the models Doctrine makes one to many relations between
Share
You can make your design of the DB, with YAML. If you want to make a N-M relation you need to do something like this (it shows a fool example about dogs with more than one owner and owners with more than a dog)
That is going to be the file.yml, so now you can generate the DB from this file. The way you can do that depends a lot on the framework or program you are working with. Anyway here there is a simple way to do it in PHP + Doctrine:
With the proper configuration you can autogenerate the id field.
In this link there is a tutorial -> Documentation
I hope this helps you!