Last active
May 21, 2025 10:18
-
-
Save Scarbous/67f53915d42bd281f4d93f74b44e2f9b to your computer and use it in GitHub Desktop.
TYPO3 extbase get SQL statement from query
This file contains hidden or 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
<?php | |
class MyRepository extends Repository | |
{ | |
function findSome() { | |
$query = $this->createQuery(); | |
$query->matching( | |
// ... | |
); | |
$queryParser = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class); | |
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Today you would use
GeneralUtility
to get theTypo3DbQueryParser
:Besides
getSQL()
the methodgetParameters()
is very helpful. See official documentation.