Last active
November 4, 2015 21:43
-
-
Save hattmarris/0d158f9a277af105bea7 to your computer and use it in GitHub Desktop.
Cake Helpful Functions
This file contains hidden or 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 | |
/** | |
* Get default data source and log last run SQL query | |
*/ | |
function getLastQuery() { | |
$dbo = ConnectionManager::getDataSource('default'); | |
$logs = $dbo->getLog(); | |
$lastLog = end($logs['log']); | |
return $lastLog['query']; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment