set up decline CGU function
This commit is contained in:
parent
1a30b94863
commit
93f786bc7e
|
@ -50,4 +50,13 @@ class CguUserService
|
||||||
$cguUser->setIsAccepted(true);
|
$cguUser->setIsAccepted(true);
|
||||||
$this->entityManager->flush();
|
$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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue