2019-08-12 07:43:37 +02:00
|
|
|
<?php
|
2021-01-07 08:50:43 +01:00
|
|
|
|
2023-11-27 10:04:42 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2023-11-09 10:27:43 +01:00
|
|
|
namespace WerkraumMedia\Events\Command;
|
2019-08-12 07:43:37 +02:00
|
|
|
|
|
|
|
use Symfony\Component\Console\Command\Command;
|
|
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
use TYPO3\CMS\Core\Core\Bootstrap;
|
2023-11-09 10:27:43 +01:00
|
|
|
use WerkraumMedia\Events\Service\CleanupService;
|
2019-08-12 07:43:37 +02:00
|
|
|
|
2019-09-17 17:14:28 +02:00
|
|
|
class RemoveAllCommand extends Command
|
|
|
|
{
|
2021-09-07 09:49:03 +02:00
|
|
|
public function __construct(
|
2023-11-27 10:04:42 +01:00
|
|
|
private readonly CleanupService $cleanupService
|
2021-09-07 09:49:03 +02:00
|
|
|
) {
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function configure(): void
|
2019-08-12 07:43:37 +02:00
|
|
|
{
|
2019-09-17 17:14:28 +02:00
|
|
|
$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();
|
2021-09-07 09:49:03 +02:00
|
|
|
$this->cleanupService->deleteAllData();
|
2021-09-06 16:32:43 +02:00
|
|
|
|
|
|
|
return 0;
|
2019-08-12 07:43:37 +02:00
|
|
|
}
|
2019-09-17 17:14:28 +02:00
|
|
|
}
|