I work with symfony2 & doctrine ;
I have 2 entities : Question
and Answer
. Logically, i would make a 1:* relation to link them.
But since the Answer
objects are not related to anything else, will never be indexed (or accessed) outside of their Question
. So I make the Question
persistent, with an attribute $answers which contains an array of Answer
s objects.
It worked fine until now. I want to take advantage of the Sonata Admin Forms, but it work only with a persistent layer (ORM or ODM).
So my questions will be :
- Is it "bad practice" to save a collection of objects in an persistent object attribute ?
- If I reverse my choice (make Answer Persistent), will it impact a lot my application ?