mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
add user moderation events #4
This commit is contained in:
parent
6ea0024b94
commit
0339ee9f23
4 changed files with 278 additions and 15 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue