Doctrine2 findBy relationship object triggers string conversion error

后端 未结 3 921
遥遥无期
遥遥无期 2020-12-05 18:49

Say I have two entities in Doctrine2 that are related to each other, Models\\User and Models\\Comment. If I do this in Doctrine 2.0.0...



        
3条回答
  •  有刺的猬
    2020-12-05 19:08

    Unfortunately, I don't think query by relationships is supported directly via repository objects.

    In this case, you are probably best to write a custom repository class with a findByUser method.

    Don't forget to update your Comment entity to use the custom repository:

提交回复
热议问题