events/Classes/Command/RemoveAllCommand.php

32 lines
868 B
PHP
Raw Normal View History

2019-08-12 07:43:37 +02:00
<?php
2019-08-12 07:43:37 +02:00
namespace Wrm\Events\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Utility\GeneralUtility;
2019-08-13 11:17:34 +02:00
use TYPO3\CMS\Extbase\Object\ObjectManager;
use Wrm\Events\Service\CleanupService;
2019-08-12 07:43:37 +02:00
class RemoveAllCommand extends Command
{
2019-08-12 07:43:37 +02:00
public function configure()
{
$this->setDescription('Remove all event data');
$this->setHelp('All events and associated data will be removed.');
2019-08-12 07:43:37 +02:00
}
protected function execute(InputInterface $input, OutputInterface $output)
{
Bootstrap::initializeBackendAuthentication();
GeneralUtility::makeInstance(ObjectManager::class)
2019-08-13 11:17:34 +02:00
->get(CleanupService::class)
->deleteAllData();
return 0;
2019-08-12 07:43:37 +02:00
}
}