lundi 20 février 2023

Doctrine : find informations (with PHP Reflection) about a transition table generated by a ManyToMany relationship

On symfony 6 and for some reasons, I need to get the informations about all tables and fields of my database (fields names of each table, which are primary key, their type (int, text, ...) ). I can handle most of table with PHP Reflection. But in the case of transition table, I must create manually the transition table manually with the make:entity command.

However, I have several ManyToMany relationship in my database. Its boring to create foreach relationship a transition table. My questions :

  • Is there a way to force symfony to create the 'transition' entities php files and repositories when I want use a ManyToMany relationship ? (I don't find the good option with the command make:entity but I maybe miss something)
  • If no, is there another way for retrieve informations about fields (fields names, know which fields are primary key, ...) from PHP Reflection without create manually all transition tables ?

Thanks for any help :)





Aucun commentaire:

Enregistrer un commentaire