vendor/doctrine/phpcr-bundle/src/Command/WorkspacePurgeCommand.php line 15

Open in your IDE?
  1. <?php
  2. namespace Doctrine\Bundle\PHPCRBundle\Command;
  3. use PHPCR\Util\Console\Command\WorkspacePurgeCommand as BaseWorkspacePurgeCommand;
  4. use Symfony\Component\Console\Input\InputInterface;
  5. use Symfony\Component\Console\Input\InputOption;
  6. use Symfony\Component\Console\Output\OutputInterface;
  7. /**
  8.  * Wrapper to use this command in the symfony console with multiple sessions.
  9.  *
  10.  * @author Daniel Barsotti <daniel.barsotti@liip.ch>
  11.  */
  12. class WorkspacePurgeCommand extends BaseWorkspacePurgeCommand
  13. {
  14.     /**
  15.      * {@inheritdoc}
  16.      */
  17.     protected function configure()
  18.     {
  19.         parent::configure();
  20.         $this
  21.             ->setName('doctrine:phpcr:workspace:purge')
  22.             ->addOption('session'nullInputOption::VALUE_REQUIRED'The session to use for this command')
  23.         ;
  24.     }
  25.     /**
  26.      * {@inheritdoc}
  27.      */
  28.     protected function execute(InputInterface $inputOutputInterface $output)
  29.     {
  30.         DoctrineCommandHelper::setApplicationPHPCRSession(
  31.             $this->getApplication(),
  32.             $input->getOption('session')
  33.         );
  34.         return parent::execute($input$output);
  35.     }
  36. }