DropSchemaDoctrineCommand.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy;
  3. use Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand;
  4. use Symfony\Component\Console\Input\InputInterface;
  5. use Symfony\Component\Console\Input\InputOption;
  6. use Symfony\Component\Console\Output\OutputInterface;
  7. /**
  8. * Command to drop the database schema for a set of classes based on their mappings.
  9. */
  10. class DropSchemaDoctrineCommand extends DropCommand
  11. {
  12. /**
  13. * {@inheritDoc}
  14. */
  15. protected function configure()
  16. {
  17. parent::configure();
  18. $this
  19. ->setName('doctrine:schema:drop')
  20. ->setDescription('Executes (or dumps) the SQL needed to drop the current database schema')
  21. ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command');
  22. }
  23. /**
  24. * {@inheritDoc}
  25. */
  26. protected function execute(InputInterface $input, OutputInterface $output)
  27. {
  28. DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
  29. return parent::execute($input, $output);
  30. }
  31. }