Dump SQL Query

Magento objects dump SQL on __toString() magic method call.

Official PHP Documentation describes aforementioned magic method as follows:
The __toString() method allows a class to decide how it will react when it is treated like a string. For example, what echo $obj; will print. This method must return a string, as otherwise a fatal E_RECOVERABLE_ERROR level error is emitted.

Zend_Debug::dump($stores->getSelect()->__toString())

Leave a Reply