Typo3 Snippets  >  Snippets  >  ExtBase und Fluid  >  ExtBase SQL-Queries debuggen

ExtBase SQL-Queries debuggen

Folgenden Code in der jeweiligen Repository-Methode vor "return $query->execute();" einfügen:

TYPO3 6.1

$parser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbBackend');  
$params = array();  
$queryParts = $parser->parseQuery($query, $params); \TYPO3\CMS\Core\Utility\DebugUtility::debug($queryParts, 'Query');  

TYPO3 6.2

$parser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbQueryParser');  
$queryParts = $parser->parseQuery($query); \TYPO3\CMS\Core\Utility\DebugUtility::debug($queryParts, 'Query');