Disable Doctrine 2 lazy loading when using JMS Serializer?

前端 未结 5 1308
梦谈多话
梦谈多话 2020-12-05 11:24

Im using Doctrine 2 ORM in my Zend project and need to serialize my Entities to JSON in several cases.

ATM i use the Querybuilder and join all tables i need. But my

5条回答
  •  -上瘾入骨i
    2020-12-05 11:57

    This may very well be called an ugly crutch, but you could just select() the data that you really need, then hydrate the result to an array using the getArrayResult() method of the Query object...

提交回复
热议问题