Last active
August 29, 2015 14:03
-
-
Save webdevilopers/b1b53daa74c0575bbde7 to your computer and use it in GitHub Desktop.
Doctrine Debug dump usage instead of var_dump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Lazy load proxies always contain an instance of Doctrine’s EntityManager and all its dependencies. | |
* Therefore a var_dump() will possibly dump a very large recursive structure which is impossible to render and read. | |
* You have to use Doctrine\Common\Util\Debug::dump() to restrict the dumping to a human readable level. | |
* Additionally you should be aware that dumping the EntityManager to a Browser may take several minutes, | |
* and the Debug::dump() method just ignores any occurrences of it in Proxy instances. | |
*/ | |
#var_dump($entity); // will possibly dump a very large recursive structure which is impossible to render and read | |
Doctrine\Common\Util\Debug::dump($entity); // restrict the dumping to a human readable level | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See tutorial: http://docs.doctrine-project.org/en/2.1/tutorials/getting-started-xml-edition.html#a-first-prototype