protected function setToken(User $user) { if (!$user->isTokenValid()) { $user->setConfirmationToken($this->tokenGenerator->generateToken()); } $user->setConfirmationTokenValidTill($this->getValidTill()); return $user; }
protected function resetTokenData(BaseUser $user) { $user->setConfirmationRequestedAt(null); $user->setConfirmationToken(null); $user->setConfirmationTokenValidTill(null); }