Commit 895dd44e authored by Arnaud Bey's avatar Arnaud Bey
Browse files

clean code

parent 73683629
......@@ -24,12 +24,13 @@ class GetMassiveJSONCommand extends ContainerAwareCommand
$em = $this->getContainer()->get('doctrine')->getEntityManager('default');
$exportManager = $this->getContainer()->get('mw_manager.export');
$massiveId = $input->getArgument('massiveId');
$massive = $em->getRepository('MagicWordBundle:GameType\Massive')->find($massiveId);
if ($massive) {
$output->writeln('<info>#########################</info>');
if ($massive = $em->getRepository('MagicWordBundle:GameType\Massive')->find($massiveId)) {
$output->writeln('<info>############ JSON EXPORT (id: '.$massiveId.') #############</info>');
$array = $exportManager->exportGame($massive);
$output->writeln(json_encode($array));
$output->writeln('<info>#########################</info>');
$output->writeln('<info>################################################</info>');
} else {
$output->writeln('<error>No massive game found for this id ('.$massiveId.')</error>');
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment