TYPO3: Get SQL from query object for debugging

raw

code.php

1
2
3
4
5
$query = $this->createQuery();
$queryParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
    \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class
);
debug($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL());
Christian Weiske Christian Weiske
owner

History