mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-22 19:36:09 +01:00
Daniel Siepmann
a9f3f108e3
The vendor was renamed from `wrm` to `werkraummedia`. And the namespace vendor was renamed from `Wrm` to `WerkraumMedia`. That way all references to PHP classes as well as the package name itself need to be adjusted.
38 lines
766 B
PHP
38 lines
766 B
PHP
<?php
|
|
|
|
namespace WerkraumMedia\Events\Service;
|
|
|
|
use WerkraumMedia\Events\Service\Cleanup\Database;
|
|
use WerkraumMedia\Events\Service\Cleanup\Files;
|
|
|
|
class CleanupService
|
|
{
|
|
/**
|
|
* @var Database
|
|
*/
|
|
private $database;
|
|
|
|
/**
|
|
* @var Files
|
|
*/
|
|
private $files;
|
|
|
|
public function __construct(Database $database, Files $files)
|
|
{
|
|
$this->database = $database;
|
|
$this->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();
|
|
}
|
|
}
|