Sulu\Bundle\ContentBundle\Command\CleanupHistoryCommand::execute PHP Метод

execute() публичный Метод

public execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    public function execute(InputInterface $input, OutputInterface $output)
    {
        $webspaceKey = $input->getArgument('webspaceKey');
        $locale = $input->getArgument('locale');
        $basePath = $input->getOption('base-path');
        $dryRun = $input->getOption('dry-run');
        $path = $this->sessionManager->getRoutePath($webspaceKey, $locale);
        $relativePath = $basePath !== null ? '/' . ltrim($basePath, '/') : '/';
        $fullPath = rtrim($path . $relativePath, '/');
        $this->cleanSession($output, $this->defaultSession, $fullPath, $dryRun);
        $this->cleanSession($output, $this->liveSession, $fullPath, $dryRun);
        if (false === $dryRun) {
            $this->defaultSession->save();
            $this->liveSession->save();
            $output->writeln('<info>Save complete</info>');
        } else {
            $output->writeln('<info>Dry run complete</info>');
        }
    }