vendor/doctrine/doctrine-bundle/Command/Proxy/ClearMetadataCacheDoctrineCommand.php line 20

Open in your IDE?
  1. <?php
  2. namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy;
  3. use Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand;
  4. use Symfony\Component\Console\Input\InputInterface;
  5. use Symfony\Component\Console\Input\InputOption;
  6. use Symfony\Component\Console\Output\OutputInterface;
  7. use function sprintf;
  8. use function trigger_error;
  9. use const E_USER_DEPRECATED;
  10. /**
  11.  * Command to clear the metadata cache of the various cache drivers.
  12.  *
  13.  * @deprecated
  14.  */
  15. class ClearMetadataCacheDoctrineCommand extends MetadataCommand
  16. {
  17.     /**
  18.      * {@inheritDoc}
  19.      */
  20.     protected function configure()
  21.     {
  22.         parent::configure();
  23.         $this
  24.             ->setName('doctrine:cache:clear-metadata')
  25.             ->setDescription('Clears all metadata cache for an entity manager');
  26.         if ($this->getDefinition()->hasOption('em')) {
  27.             return;
  28.         }
  29.         $this->addOption('em'nullInputOption::VALUE_OPTIONAL'The entity manager to use for this command');
  30.     }
  31.     /**
  32.      * {@inheritDoc}
  33.      */
  34.     protected function execute(InputInterface $inputOutputInterface $output)
  35.     {
  36.         @trigger_error(sprintf('The "%s" (doctrine:cache:clear-metadata) is deprecated, metadata cache now uses PHP Array cache which can not be cleared.'self::class), E_USER_DEPRECATED);
  37.         DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
  38.         return parent::execute($input$output);
  39.     }
  40. }