Created
June 10, 2020 10:08
-
-
Save Schweriner/bc210af4c16e987d8cd1287c1dee4f23 to your computer and use it in GitHub Desktop.
Debug TYPO3 Doctrine Query
This file contains 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
$queryParser = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class); | |
$sql = $queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL(); | |
$paramters = $queryParser->convertQueryToDoctrineQueryBuilder($query)->getParameters(); | |
$search = array(); | |
$replace = array(); | |
foreach ($paramters as $k => $v) { | |
$search[] = ':' . $k; | |
$replace[] = '\'' . $v . '\''; | |
} | |
$sql = str_replace($search, $replace, $sql); | |
print_r($sql); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment