0 votes

Hi,
i'm currently testing skipper18 and imported a symfony2/doctrine2 project that I'm workin on.
My problem is with many2many relations.
Skipper imports 4 entities for one relation:
Lets say i have

Article <-> ArticleCategory <-> Category

When I import i get the entities:

Article, article_category, ArticleCategory, Category

So i thougt perhaps my annotations are wrong and created a new project where i did the many2many relation between Article and Category.
But now, when i export this, i'm missing the file for the inBetween table.

Am I missing something?

in Solved by (150 points)
reshown by

1 Answer

0 votes
Best answer

Hi,

It depends not on how are your associations defined, but there are some limitations which Doctrine2 has for MN entities.

The main limitation is in way how Doctrine2 handles these associations. Doctrine 2 doesn't allow to have separate entity for MN entity and store any data inside this entity. Because of that, if you need to store any data inside this entity, you need to redefine MN association as two separated one-to-many associations.

The problem with four imported entities is probably caused by incorrectly defined mn-association, or maybe you have defined many-to-many and one-to-many together to single entity. And because of the limitation I described above, Skipper creates two entities. One for MN entity and second for one-to-many associations.

For more detailed answer and solution please send us definitions with your Article, ArticleCategory and Category. You can post it here or send it to [email protected]

by Skipper developer (138k points)
selected by

Hi, you are right. I need to store additional data in the MN entity. (rank field) Thank you for your fast answer.