add user moderation events #4

This commit is contained in:
ghost 2023-10-11 04:04:02 +03:00
parent 6ea0024b94
commit 0339ee9f23
4 changed files with 278 additions and 15 deletions

View file

@ -179,7 +179,7 @@ class UserService
public function toggleUserModerator(
int $userId
): void
): ?User
{
if ($user = $this->getUser($userId))
{
@ -190,11 +190,13 @@ class UserService
$this->entityManagerInterface->persist($user);
$this->entityManagerInterface->flush();
}
return $user;
}
public function toggleUserStatus(
int $userId
): void
): ?User
{
if ($user = $this->getUser($userId))
{
@ -205,11 +207,13 @@ class UserService
$this->entityManagerInterface->persist($user);
$this->entityManagerInterface->flush();
}
return $user;
}
public function toggleUserApproved(
int $userId
): void
): ?User
{
if ($user = $this->getUser($userId))
{
@ -220,5 +224,7 @@ class UserService
$this->entityManagerInterface->persist($user);
$this->entityManagerInterface->flush();
}
return $user;
}
}