You are here

public function UserEmailVerification::isReminderNeeded in User email verification 8

Checks: Can we remind user right now.

Parameters

int $uid: User ID.

Return value

bool Result of check.

Overrides UserEmailVerificationInterface::isReminderNeeded

1 call to UserEmailVerification::isReminderNeeded()
UserEmailVerification::remindUserById in src/UserEmailVerification.php
Reminds user about verification user by ID.

File

src/UserEmailVerification.php, line 485

Class

UserEmailVerification
User email verification helper service.

Namespace

Drupal\user_email_verification

Code

public function isReminderNeeded($uid) {

  // Only send the reminder if the user is not verified yet
  // and the number of reminders has not been reached yet.
  return (bool) $this->database
    ->select(UserEmailVerificationInterface::VERIFICATION_TABLE_NAME, 'uev')
    ->fields('uev', [
    'uid',
  ])
    ->condition('uev.uid', $uid, '=')
    ->condition('uev.verified', 0, '=')
    ->condition('uev.reminders', $this
    ->getNumReminders(), '<')
    ->condition('uev.last_reminder', $this->time
    ->getRequestTime() - $this
    ->getReminderInterval(), '<')
    ->execute()
    ->fetchField();
}