Use enum for undo mode

This commit is contained in:
Jan Böhmer 2023-06-18 21:26:28 +02:00
parent 218b0adb8f
commit 8a20584e27
14 changed files with 140 additions and 180 deletions

View file

@ -42,6 +42,7 @@ declare(strict_types=1);
namespace App\Entity\Contracts;
use App\Entity\LogSystem\AbstractLogEntry;
use App\Services\LogSystem\EventUndoMode;
interface LogWithEventUndoInterface
{
@ -60,12 +61,12 @@ interface LogWithEventUndoInterface
*
* @return $this
*/
public function setUndoneEvent(AbstractLogEntry $event, string $mode = 'undo'): self;
public function setUndoneEvent(AbstractLogEntry $event, EventUndoMode $mode = EventUndoMode::UNDO): self;
/**
* Returns the mode how the event was undone:
* "undo" = Only a single event was applied to element
* "revert" = Element was reverted to the state it was to the timestamp of the log.
*/
public function getUndoMode(): string;
public function getUndoMode(): EventUndoMode;
}