ConvertMappingDoctrineCommand.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Symfony\Framework\DoctrineBundle\Command;
  3. use Symfony\Components\Console\Input\InputArgument;
  4. use Symfony\Components\Console\Input\InputOption;
  5. use Symfony\Components\Console\Input\InputInterface;
  6. use Symfony\Components\Console\Output\OutputInterface;
  7. use Symfony\Components\Console\Output\Output;
  8. use Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand;
  9. /*
  10. * This file is part of the Symfony framework.
  11. *
  12. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  13. *
  14. * This source file is subject to the MIT license that is bundled
  15. * with this source code in the file LICENSE.
  16. */
  17. /**
  18. * Convert Doctrine ORM metadata mapping information between the various supported
  19. * formats.
  20. *
  21. * @package Symfony
  22. * @subpackage Framework_DoctrineBundle
  23. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  24. * @author Jonathan H. Wage <jonwage@gmail.com>
  25. */
  26. class ConvertMappingDoctrineCommand extends ConvertMappingCommand
  27. {
  28. protected function configure()
  29. {
  30. parent::configure();
  31. $this
  32. ->setName('doctrine:mapping:convert')
  33. ->addOption('em', null, InputOption::PARAMETER_OPTIONAL, 'The entity manager to use for this command.')
  34. ->setHelp(<<<EOT
  35. The <info>doctrine:mapping:convert</info> command converts mapping information between supported formats:
  36. <info>./symfony doctrine:mapping:convert xml /path/to/output</info>
  37. EOT
  38. );
  39. }
  40. protected function execute(InputInterface $input, OutputInterface $output)
  41. {
  42. DoctrineCommand::setApplicationEntityManager($this->application, $input->getOption('em'));
  43. return parent::execute($input, $output);
  44. }
  45. }