doctrine/orm · error · RuntimeException
Argument 'dql' is required in order to execute this command
Error message
Argument 'dql' is required in order to execute this command correctly.
What it means
Error "Argument 'dql' is required in order to execute this command correctly." thrown in doctrine/orm.
Source
Thrown at src/Tools/Console/Command/RunDqlCommand.php:67
<info>php %command.full_name% "SELECT u FROM App\Entity\User u" --hydrate=array</info>
Additionally you can specify the first result and maximum amount of results to
show:
<info>php %command.full_name% "SELECT u FROM App\Entity\User u" --first-result=0 --max-result=30</info>
EOT);
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$ui = new SymfonyStyle($input, $output);
$em = $this->getEntityManager($input);
$dql = $input->getArgument('dql');
if ($dql === null) {
throw new RuntimeException("Argument 'dql' is required in order to execute this command correctly.");
}
$depth = $input->getOption('depth');
if (! is_numeric($depth)) {
throw new LogicException("Option 'depth' must contain an integer value");
}
$hydrationModeName = (string) $input->getOption('hydrate');
$hydrationMode = 'Doctrine\ORM\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationModeName));
if (! defined($hydrationMode)) {
throw new RuntimeException(sprintf(
"Hydration mode '%s' does not exist. It should be either: object. array, scalar or single-scalar.",
$hydrationModeName,
));
}
View on GitHub (pinned to d9b9ff7301)
When it happens
Trigger: Thrown at src/Tools/Console/Command/RunDqlCommand.php:67 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of doctrine/orm@d9b9ff7301 (2026-08-21).
Data as JSON: /api/errors/9f689f1eb16df39a.
Report an issue: GitHub.