I'm using the ZF2 paginator like so:
// Paginator config
$paginator_adapter = new DbSelect($select, $adapter);
$paginator = new Paginator($paginator_adapter);
$paginator->setItemCountPerPage(20);
$paginator->setCurrentPageNumber($page);
return $paginator;
How can I echo the built SQL query for debugging?
Take a look at ZendDeveloperTools
: https://samsonasik.wordpress.com/2012/08/07/zend-developer-tools-zf2-debug-toolbar-install/
ZendDeveloperTools is a Module for developer and debug tools for working with the ZF2 MVC layer. It can show you a request method, response code, current controller/action, current route we access, execution time, memory consumption, grab the profiler of Zend\Db adapter instance, and Zend Framework version you currently use.
Figured it out myself, thanks tho.
echo $select->getSqlString($adapter->getPlatform());