Digi92
2/26/2018 - 11:47 AM

TYPO3 >= 8 Query Debug

Short description for get the raw SQL statement of your TYPO3 Extbase query statement. Found on: https://www.typo3.net/forum/thematik/zeige/thema/125747/

// Hiermit erhältst du das prepared statement:
$queryParser = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class);

//For the SQL statement
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL());

// For the paramenter vlaues
// Because in the SQL statment only placeholders (":dcValue") set for the parameters
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getParameters());
// Hiermit erhältst du das prepared statement:
$queryParser = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class);

//For the SQL statement
$sqlStatment = $queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL();

// For the paramenter vlaues
// Because in the SQL statment only placeholders (":dcValue") set for the parameters
$sqlParameters = $queryParser->convertQueryToDoctrineQueryBuilder($query)->getParameters();