Neos\Flow\Command\DoctrineCommandController::dqlCommand PHP Метод

dqlCommand() публичный Метод

Any DQL queries passed after the parameters will be executed, the results will be output: doctrine:dql --limit 10 'SELECT a FROM Neos\Flow\Security\Account a'
public dqlCommand ( integer $depth = 3, string $hydrationMode = 'array', integer $offset = null, integer $limit = null ) : void
$depth integer How many levels deep the result should be dumped
$hydrationMode string One of: object, array, scalar, single-scalar, simpleobject
$offset integer Offset the result by this number
$limit integer Limit the result to this number
Результат void
    public function dqlCommand($depth = 3, $hydrationMode = 'array', $offset = null, $limit = null)
    {
        if (!$this->isDatabaseConfigured()) {
            $this->outputLine('DQL query is not possible, the driver and host backend options are not set in /Configuration/Settings.yaml.');
            $this->quit(1);
        }
        $dqlStatements = $this->request->getExceedingArguments();
        $hydrationModeConstant = 'Doctrine\\ORM\\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationMode));
        if (!defined($hydrationModeConstant)) {
            throw new \InvalidArgumentException('Hydration mode "' . $hydrationMode . '" does not exist. It should be either: object, array, scalar or single-scalar.');
        }
        foreach ($dqlStatements as $dql) {
            $resultSet = $this->doctrineService->runDql($dql, constant($hydrationModeConstant), $offset, $limit);
            Debug::dump($resultSet, $depth);
        }
    }