ClearMetadataCacheDoctrineCommand.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Symfony\Framework\DoctrineBundle\Command;
  3. use Symfony\Components\Console\Input\InputOption;
  4. use Symfony\Components\Console\Input\InputInterface;
  5. use Symfony\Components\Console\Output\OutputInterface;
  6. use Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand;
  7. /*
  8. * This file is part of the Symfony framework.
  9. *
  10. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  11. *
  12. * This source file is subject to the MIT license that is bundled
  13. * with this source code in the file LICENSE.
  14. */
  15. /**
  16. * Command to clear the metadata cache of the various cache drivers.
  17. *
  18. * @package Symfony
  19. * @subpackage Framework_DoctrineBundle
  20. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  21. * @author Jonathan H. Wage <jonwage@gmail.com>
  22. */
  23. class ClearMetadataCacheDoctrineCommand extends MetadataCommand
  24. {
  25. protected function configure()
  26. {
  27. parent::configure();
  28. $this->setName('doctrine:clear-cache:metadata');
  29. $this->addOption('em', null, InputOption::PARAMETER_OPTIONAL, 'The entity manager to clear the cache for.');
  30. }
  31. protected function execute(InputInterface $input, OutputInterface $output)
  32. {
  33. DoctrineCommand::setApplicationEntityManager($this->application, $input->getOption('em'));
  34. return parent::execute($input, $output);
  35. }
  36. }