Skip to content

Instantly share code, notes, and snippets.

@Schweriner
Created June 10, 2020 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Schweriner/bc210af4c16e987d8cd1287c1dee4f23 to your computer and use it in GitHub Desktop.
Save Schweriner/bc210af4c16e987d8cd1287c1dee4f23 to your computer and use it in GitHub Desktop.
Debug TYPO3 Doctrine Query
$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