events/Classes/Command/RemoveAllCommand.php
Daniel Siepmann 81065f5c67
BREAKING: TYPO3 v12 support (#44)
* Migrated all fixtures to PHP.
* Removed version specific adjustments.
2023-11-27 10:04:42 +01:00

35 lines
884 B
PHP

<?php
declare(strict_types=1);
namespace WerkraumMedia\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 WerkraumMedia\Events\Service\CleanupService;
class RemoveAllCommand extends Command
{
public function __construct(
private readonly CleanupService $cleanupService
) {
parent::__construct();
}
public function configure(): void
{
$this->setDescription('Remove all event data');
$this->setHelp('All events and associated data will be removed.');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
Bootstrap::initializeBackendAuthentication();
$this->cleanupService->deleteAllData();
return 0;
}
}