mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-10 07:16:13 +01:00
Daniel Siepmann
018fdc697e
The command should always return an integer as exit code. The called method does not return anything, resulting in null to be returned.
31 lines
868 B
PHP
31 lines
868 B
PHP
<?php
|
|
|
|
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;
|
|
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
|
use Wrm\Events\Service\CleanupService;
|
|
|
|
class RemoveAllCommand extends Command
|
|
{
|
|
public function configure()
|
|
{
|
|
$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();
|
|
|
|
GeneralUtility::makeInstance(ObjectManager::class)
|
|
->get(CleanupService::class)
|
|
->deleteAllData();
|
|
|
|
return 0;
|
|
}
|
|
}
|