1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Notifications: Switched testing from string to reference levels

This commit is contained in:
Dan Brown
2023-08-17 18:10:34 +01:00
parent 38829f8a38
commit e709caa005
4 changed files with 25 additions and 19 deletions

View File

@ -51,15 +51,20 @@ class UserEntityWatchOptions
return null;
}
public function updateWatchLevel(string $level): void
public function updateLevelByName(string $level): void
{
$levelValue = WatchLevels::levelNameToValue($level);
if ($levelValue < 0) {
$this->updateLevelByValue($levelValue);
}
public function updateLevelByValue(int $level): void
{
if ($level < 0) {
$this->remove();
return;
}
$this->updateLevel($levelValue);
$this->updateLevel($level);
}
public function getWatchMap(): array