@@ 234-244 (lines=11) @@ | ||
231 | return $this->getEmailConfirmationTokenAttempts() > 5; |
|
232 | } |
|
233 | ||
234 | public function generateEmailConfirmationToken($token = null, DateInterval $expiration = null): UserEntityInterface |
|
235 | { |
|
236 | if (null === $expiration) { |
|
237 | $expiration = new DateInterval('P1D'); |
|
238 | } |
|
239 | $this->setEmailConfirmationTokenAttempts(0); |
|
240 | $this->setEmailConfirmationToken(null === $token ? Token::generate(40) : $token); |
|
241 | $this->setEmailConfirmationTokenExpirationDatetime((new DateTime())->add($expiration)); |
|
242 | $this->setLastEmailTokenGeneratedDatetime(new DateTime()); |
|
243 | return $this; |
|
244 | } |
|
245 | ||
246 | /** @return string */ |
|
247 | public function getDeletedEmail() |
|
@@ 320-330 (lines=11) @@ | ||
317 | UserEntityInterface::EMAIL_COOLDOWN; |
|
318 | } |
|
319 | ||
320 | public function generatePasswordResetToken($token = null, DateInterval $expiration = null): UserEntityInterface |
|
321 | { |
|
322 | if (null === $expiration) { |
|
323 | $expiration = new DateInterval('P1D'); |
|
324 | } |
|
325 | ||
326 | $this->setPasswordResetToken(null === $token ? Token::generate(40) : $token); |
|
327 | $this->setPasswordResetTokenExpirationDatetime((new DateTime())->add($expiration)); |
|
328 | $this->setLastPasswordResetTokenGeneratedDatetime(new DateTime()); |
|
329 | return $this; |
|
330 | } |
|
331 | ||
332 | protected function hashPassword(): UserEntityInterface |
|
333 | { |