Getting a “true” object from a proxy object in doctrine2

前端 未结 11 1572
南笙
南笙 2021-02-01 13:50

Doctrine uses proxy objects to represent related objects in order to facilitate lazy loading. This is a really cool feature, but its causing an issue with something I am trying

11条回答
  •  渐次进展
    2021-02-01 14:26

    Edit: As mention by @flu this approach don't return the "true" object. However it can be useful in case if you need the data from the object. Then, you can just get the real object from ObjectManager by some of identity.


    We can use __load() method from Proxy interface

    $proxyObject->__load();
    

提交回复
热议问题