0

Whenever I use Xdebug to debug variables I see alot of Proxies\__CG__\ classes instead of my real classes. Is there any way to disable these? I want to eager load everything instead of lazy loading.

These Proxy (entity) classes have every property null, only the id is filled. This is not nice when using Xdebug to debug values from variables.

When I'm using the 'Evaluate Expression' tool, I can do $entity->getSomeEntity()->getName(); and it's not empty (lazy loading?). But without evaluating the expression, the value is null.

Tried to change Doctrine configuration auto_generate_proxy_classes to 0 but weirdly this doesn't seem to change a thing.

sbkevin
  • 11
  • 1
  • 3
  • AFAIK the proxy classes will always be used, the setting `auto_generate_proxy_classes` just determines if they will be generated on runtime or not. Mybe this helps understanding: https://stackoverflow.com/questions/4923817/what-is-a-proxy-in-doctrine-2?rq=1 – john Smith Jan 09 '23 at 15:44
  • > $entity->getSomeEntity()->getName(); and it's not empty (lazy loading?). that's the point of lazy loading :) You could change your relations to `fetch="EAGER"` but **it could cause** massive performance drop! – V-Light Jan 10 '23 at 17:05

0 Answers0