mirror of
https://github.com/werkraum-media/events.git
synced 2024-12-23 14:46:09 +01:00
Daniel Siepmann
ca4d7d3a01
Allows to remove all existing records regarding events. It will search for all pages providing either organizer or events, and will delete both types of records. As DataHandler is used for deletion, there is already logging within TYPO3, as well as recursive deletion for dates and sys_file_references. To speedup for large data sets, truncate organizer and dates, as they don't have recursive deletions, e.g. to sys_file_references. Also add keys to database.
28 lines
855 B
PHP
28 lines
855 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();
|
|
|
|
return GeneralUtility::makeInstance(ObjectManager::class)
|
|
->get(CleanupService::class)
|
|
->deleteAllData();
|
|
}
|
|
}
|