Skip to content

Commit

Permalink
fixes a bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
schmittjoh committed Nov 2, 2013
1 parent 5586ddd commit 0cd6061
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Util\Debug;
use JMS\Serializer\SerializerBuilder;

/**
* Command to execute DQL queries in a given EntityManager.
Expand Down Expand Up @@ -65,11 +64,6 @@ protected function configure()
new InputOption(
'depth', null, InputOption::VALUE_REQUIRED,
'Dumping depth of Entity graph.', 7
),
new InputOption(
'format', null, InputOption::VALUE_REQUIRED,
'The output format of the result. Available formats: doctrine-debug (default), jms-serializer-json.',
'doctrine-debug'
)
))
->setHelp(<<<EOT
Expand Down Expand Up @@ -124,22 +118,6 @@ protected function execute(InputInterface $input, OutputInterface $output)

$resultSet = $query->execute(array(), constant($hydrationMode));

switch ($input->getOption('format')) {
case 'doctrine-debug':
ob_start();
Debug::dump($resultSet, $input->getOption('depth'));
$message = ob_get_clean();

$output->write($message);
break;

case 'jms-serializer-json':
$serializer = SerializerBuilder::create()->build();
$output->write($serializer->serialize($resultSet, 'json'));
break;

default:
throw new \RuntimeException(sprintf('Unknown output format "%s"; available formats: doctrine-debug, jms-serializer-json', $input->getOption('format')));
}
Debug::dump($resultSet, $input->getOption('depth'));
}
}

0 comments on commit 0cd6061

Please sign in to comment.