Lazy-loading properties not loading in Doctrine 2.0

后端 未结 2 1105
感动是毒
感动是毒 2021-01-14 22:50

I\'m using PHP and Doctrine 2.0. All entities work fine, with the exception of the entity-relation detailed below (or other entities are failing where I\'m not noticing it).

相关标签:
2条回答
  • 2021-01-14 23:28

    As seen above in my question, I've added the fetch="EAGER" attribute to the relational annotation, and now everything seems to go just fine (except for the fact that loading is no longer lazy).

    This is of course a workaround, and no fix of the actual bug. In addition to this, I still don't know what caused my code/Doctrine to break. However, the performance impact of this workaround seems to be negligible - if even present at all.

    0 讨论(0)
  • 2021-01-14 23:32

    It looks like internal d2 bug. Or you use reflection to retrieve properties of your object. Proxy classes use persister to initialize them on any method call. Does it issue a query when you use getter on this proxy?

    0 讨论(0)
提交回复
热议问题