A
A
Araik2021-07-14 09:06:53
symfony
Araik, 2021-07-14 09:06:53

How to specify relationship between 2 entities through 3 entities in Doctrine?

I have 3 entities (Entity) :

  • Project - Project entity (id, name, description)
  • Group - Group entity (id, name)
  • GroupLink - Entity of the linking table ( id, project_id, group_id )


How to correctly specify the links so that the Group is available in the Project entity, if the relationship between them is through the 3rd table (GroupLink entity)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Araik, 2021-07-14
@NinjaNickName

Entity1 - OneToMany Entity2
Entity2 - ManyToOne Entity1 + ManyToOne Entity3
Entity3 - OneToMany Entity2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question