mirror of
https://github.com/werkraum-media/events.git
synced 2024-12-30 20:06:10 +01:00
Daniel Siepmann
1f769939b4
Properly cleanup system. Delete further records when deleting everything. Also respect further records when purging old entries. Respect: * sys_category_record_mm * sys_file_reference * sys_file_metadata
39 lines
973 B
PHP
39 lines
973 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 Wrm\Events\Service\CleanupService;
|
|
|
|
class RemovePastCommand extends Command
|
|
{
|
|
/**
|
|
* @var CleanupService
|
|
*/
|
|
private $cleanupService;
|
|
|
|
public function __construct(
|
|
CleanupService $cleanupService
|
|
) {
|
|
$this->cleanupService = $cleanupService;
|
|
|
|
parent::__construct();
|
|
}
|
|
|
|
public function configure(): void
|
|
{
|
|
$this->setDescription('Remove past events');
|
|
$this->setHelp('Past dates are removed, together with events that do not have any left dates.');
|
|
}
|
|
|
|
protected function execute(InputInterface $input, OutputInterface $output)
|
|
{
|
|
Bootstrap::initializeBackendAuthentication();
|
|
|
|
$this->cleanupService->deletePastData();
|
|
return 0;
|
|
}
|
|
}
|