php - How can I access pivot table attributes in doctrine without having entity for it
I have a many to many relationship between Location and Areas. So there are three tables location, areas and location_area(the pivot table). Now as we know on the pivot table I only have foreign keys from both table. So doctrine won't allow an entity for it as it requires primary key for an entity and logically the two foreign keys form a surrogate key. I don't want to add an extra column id to the table.
I have areas many to many relationship on the location table. So this is the query that I have wrote.
And I need the location_areas table attribute for some condition. when I tried to access its attribute via the join that I have made above. Since it is a join with the many to many relationship areas so I assume it should return the pivot table attributes as well but it never does, What should I do in this situation.
Any help will be appreciated.