Too much data with var_dump in symfony2 doctrine2

后端 未结 9 1464
夕颜
夕颜 2020-11-28 02:37

I have around 40 entities and many bidirectional relationships. Whenever i use var_dump($user) or any entity my browser gets loaded with too much data of arrays and variable

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 03:15

    Replace var_dump() with the debug method dump() provided by Doctrine Common.

    \Doctrine\Common\Util\Debug::dump($user);
    

    It works for single objects and Doctrine collections and should prevent browser displaying issues you are having.

提交回复
热议问题