events/Classes/Service/CleanupService.php
Daniel Siepmann 81065f5c67
BREAKING: TYPO3 v12 support (#44)
* Migrated all fixtures to PHP.
* Removed version specific adjustments.
2023-11-27 10:04:42 +01:00

31 lines
666 B
PHP

<?php
declare(strict_types=1);
namespace WerkraumMedia\Events\Service;
use WerkraumMedia\Events\Service\Cleanup\Database;
use WerkraumMedia\Events\Service\Cleanup\Files;
final class CleanupService
{
public function __construct(
private readonly Database $database,
private readonly Files $files
) {
}
public function deleteAllData(): void
{
$this->database->truncateTables();
$this->files->deleteDangling();
}
public function deletePastData(): void
{
$this->database->deletePastDates();
$this->database->deleteEventsWithoutDates();
$this->files->deleteDangling();
}
}