View Single Post
  #1  
Old 08-02-2014, 02:34 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Printing Doctrine Objects

When I first started working with X-cart 5, I had no idea how to print the contents of objects to the screen. Just now I forgot and had to go look it up again...

X-cart 5 is not just OOP PHP vs Procedural PHP, it also utilizes Doctrine for working with the DB.Those unfamiliar with Doctrine can have a hard time!

Sharing it here for all that are looking:

print_r($entity);
Should be actually:
\Doctrine\Common\Util\Debug::dump($entity);

Taken from:
http://www.davelachapelle.ca/2013/01/25/dumping-doctrine-entities-without-print_r/
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote