1

我想从 Flow Framework 中的对象打印 SQL 查询。

$query = $this->createQuery();

        return $query->matching(
            $query->logicalAnd(
                $query->equals('account.accountIdentifier', trim($email)),
                $query->equals('isBlocked', 0)
            )
        )->execute();
4

1 回答 1

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());
于 2015-06-18T06:26:38.893 回答