Created
May 29, 2013 05:08
-
-
Save sthamann/5668095 to your computer and use it in GitHub Desktop.
Usage doctrine sql logger
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
$logger = new \Doctrine\DBAL\Logging\DebugStack(); | |
$logger->enabled; | |
Shopware()->Models()->getConfiguration()->setSQLLogger($logger); | |
// Shopware Doctrine Queries | |
//get access on the customer repository | |
$query = $this->getRepository()->getListQuery($filter, $customerGroup, $sort, $limit, $offset); | |
//returns the total count of the query | |
$totalResult = $this->getManager()->getQueryCount($query); | |
//returns the customer data | |
$customers = $query->getArrayResult(); | |
// Dump SQL | |
echo '<pre>'; | |
\Doctrine\Common\Util\Debug::dump($logger, 5); | |
exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment