Doctrine ORM Conditional Association
问题 i'm building a Q&A site and my questions, answers and comments are on the same posts table. But their postType is different. I can get answers for a question and comments for an answer with this association: /** * @OneToMany(targetEntity="Cms\Entity\Post", mappedBy="parent") */ private $answers; /** * @OneToMany(targetEntity="Cms\Entity\Post", mappedBy="parent") */ private $comments; But i think this is not the correct way to do this because if i fetch a question both answers and comments are