Newscoop\Tools\Console\Command\UserGarbageCollectionCommand::execute PHP Метод

execute() защищенный Метод

protected 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
    protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
    {
        $systemPreferences = $this->getContainer()->getService('system_preferences_service');
        $text = '<info>Obsolete pending users successfuly removed.</info>';
        try {
            if ($input->getOption('force')) {
                $this->getContainer()->getService('user.garbage')->run($systemPreferences->get('userGarbageDays'));
                if ($input->getOption('verbose')) {
                    $output->writeln($text);
                }
            } elseif ($systemPreferences->get('userGarbageActive') === 'Y' && !is_null($systemPreferences->get('userGarbageActive'))) {
                $this->getContainer()->getService('user.garbage')->run($systemPreferences->get('userGarbageDays'));
                if ($input->getOption('verbose')) {
                    $output->writeln($text);
                }
            }
        } catch (\Exception $e) {
            throw new \Exception($e->getMessage());
        }
    }
UserGarbageCollectionCommand