You are here

public function DefaultController::_username_check_is_mail_exists in Username originality AJAX check 8

Query user table to check if such mail is already exists.

1 call to DefaultController::_username_check_is_mail_exists()
DefaultController::username_check_mail_callback in src/Controller/DefaultController.php

File

src/Controller/DefaultController.php, line 156
Contains \Drupal\username_check\Controller\DefaultController.

Class

DefaultController
Default controller for the username_check module.

Namespace

Drupal\username_check\Controller

Code

public function _username_check_is_mail_exists($mail) {
  return db_query("SELECT COUNT(u.mail) count FROM {users_field_data} u WHERE LOWER(u.mail) = LOWER(@mail)", array(
    '@mail' => $mail,
  ))
    ->fetchField();
}