set up decline CGU function

This commit is contained in:
Charles 2025-04-23 10:34:45 +02:00
parent 1a30b94863
commit 93f786bc7e
1 changed files with 9 additions and 0 deletions

View File

@ -50,4 +50,13 @@ class CguUserService
$cguUser->setIsAccepted(true);
$this->entityManager->flush();
}
//Function can only be called if the user has already accepted the CGU
public function declineCgu(UserInterface $user, Cgu $cgu): void
{
$cguUser = $this->entityManager->getRepository(CguUser::class)->findOneBy(['users' => $user, 'cgu' => $cgu]);
$cguUser->setIsAccepted(false);
$this->entityManager->flush();
}
}