Skip to content

Latest commit

 

History

History
10 lines (8 loc) · 926 Bytes

File metadata and controls

10 lines (8 loc) · 926 Bytes

Private methods do not trigger \Doctrine\ORM\Proxy->__load (consistency issue)

Problem:

Solutions:

  • Use only public methods when working with instances other than $this (even thought PHP allows you to access private properties of the same class but different instance) --> May ruin encapsulation
  • Explicitly trigger the proxy load by calling $object->__load before accessing private property/method