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

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 trigger_deprecation;
  8. /**
  9.  * Command to clear the metadata cache of the various cache drivers.
  10.  *
  11.  * @deprecated
  12.  */
  13. class ClearMetadataCacheDoctrineCommand extends MetadataCommand
  14. {
  15.     /**
  16.      * {@inheritDoc}
  17.      */
  18.     protected function configure()
  19.     {
  20.         parent::configure();
  21.         $this
  22.             ->setName('doctrine:cache:clear-metadata')
  23.             ->setDescription('Clears all metadata cache for an entity manager');
  24.         if ($this->getDefinition()->hasOption('em')) {
  25.             return;
  26.         }
  27.         $this->addOption('em'nullInputOption::VALUE_OPTIONAL'The entity manager to use for this command');
  28.     }
  29.     /**
  30.      * {@inheritDoc}
  31.      */
  32.     protected function execute(InputInterface $inputOutputInterface $output)
  33.     {
  34.         trigger_deprecation(
  35.             'doctrine/doctrine-bundle',
  36.             '2.3',
  37.             'The "%s" (doctrine:cache:clear-metadata) is deprecated, metadata cache now uses PHP Array cache which can not be cleared.',
  38.             self::class
  39.         );
  40.         DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
  41.         return parent::execute($input$output);
  42.     }
  43. }