Suppose I have two entities in my Symfony2 package, User and Group . Associated with a many-to-many relationship.
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ | USER | | USER_GROUP_REL | | GROUP | โโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโค | id# โ---------โค user_id# | โ----โค id
What would be good practice or a good approach to add additional columns to the join table, for example, to the creation date, which represents the date that User joined the Group ?
I know that I could use QueryBuilder to write an INSERT .
But as far as I have not seen any example of INSERT QueryBuilder or native SQL, which leads me to believe that ORM / Doctrine try to avoid direct INSERT statements (for example, for security reasons). Plus, as I understood Symfony and Doctrine, I would be stunned if such a general requirement were not covered by the frame.
source share