我想在Flow Framework中从对象打印SQL查询。
$query = $this->createQuery();
return $query->matching(
$query->logicalAnd(
$query->equals('account.accountIdentifier', trim($email)),
$query->equals('isBlocked', 0)
)
)->execute();
答案 0 :(得分:1)
试试这个我会打印sql / dql查询:
/** @var $query \TYPO3\Flow\Persistence\Doctrine\Query */
/** @var $doctrineQueryBuilder \Doctrine\ORM\QueryBuilder */
$doctrineQueryBuilder = \TYPO3\Flow\Reflection\ObjectAccess::getProperty($query, 'queryBuilder', TRUE);
/** @var $doctrineQuery \Doctrine\ORM\Query */
$doctrineQuery = $doctrineQueryBuilder->getQuery();
\TYPO3\Flow\var_dump($doctrineQuery->getDQL());
\TYPO3\Flow\var_dump($doctrineQuery->getSQL());