mirror of
https://github.com/werkraum-media/events.git
synced 2024-12-23 07:26:10 +01:00
Daniel Siepmann
f618536ff9
In order to static analyze code and prevent bugs when changing code. Fix issues in most of the files.
30 lines
902 B
PHP
30 lines
902 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 RemovePastCommand extends Command
|
|
{
|
|
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();
|
|
|
|
GeneralUtility::makeInstance(ObjectManager::class)
|
|
->get(CleanupService::class)
|
|
->deletePastData();
|
|
return 0;
|
|
}
|
|
}
|