0

In a database I have the tables User, Group and UsersInGroup and generate the entities from the database using the Symfony 2 console. The table UsersInGroup is not generated as an entity but is partly generated into User and Group. This would be perfect if UsersInGroup hat only two columns userId and groupId (together primarykey), in this case the table UsersInGroup also contains a third column Role. This field is can never be filled using the generated entities

How should I fill the Role column in the tabel UsersInGroup?

Roel Veldhuizen
  • 4,613
  • 8
  • 44
  • 78
  • Did you try defining `UsersInGroup`? Try to match the automatic definition and add your own column and relations. – greg0ire Dec 12 '11 at 08:56

1 Answers1

0

You have to declare your relation table manually and to map the relations.

You'll find an interesting discussion here:

Doctrine2: Best way to handle many-to-many with extra columns in reference table

Community
  • 1
  • 1
Herzult
  • 3,429
  • 22
  • 15