1
0
mirror of synced 2025-01-18 22:41:43 +03:00

#1262 DDC-3513 - RunDqlCommand should write to the output object rather than to the output buffer

This commit is contained in:
Marco Pivetta 2015-01-17 21:31:00 +01:00
parent f06d652393
commit fea0425a4f

View File

@ -81,6 +81,7 @@ EOT
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
/* @var $em \Doctrine\ORM\EntityManagerInterface */
$em = $this->getHelper('em')->getEntityManager();
if (($dql = $input->getArgument('dql')) === null) {
@ -120,13 +121,13 @@ EOT
$query->setMaxResults((int) $maxResult);
}
if ($input->hasOption('show-sql') && $input->getOption('show-sql')) {
Debug::dump($query->getSQL());
if ($input->getOption('show-sql')) {
$output->writeln(Debug::dump($query->getSQL(), 2, true, false));
return;
}
$resultSet = $query->execute(array(), constant($hydrationMode));
Debug::dump($resultSet, $input->getOption('depth'));
$output->writeln(Debug::dump($resultSet, $input->getOption('depth'), true, false));
}
}