You are here

private static function UserCsvImportController::usernameExists in User CSV import 2.0.x

Same name and namespace in other branches
  1. 8 src/Controller/UserCsvImportController.php \Drupal\user_csv_import\Controller\UserCsvImportController::usernameExists()
  2. 1.0.x src/Controller/UserCsvImportController.php \Drupal\user_csv_import\Controller\UserCsvImportController::usernameExists()

Returns user whose name matches $username.

Parameters

string $username: Username to check.

Return value

array Users whose names match username.

1 call to UserCsvImportController::usernameExists()
UserCsvImportController::prepareRow in src/Controller/UserCsvImportController.php
Prepares a new user from an upload row and current config.

File

src/Controller/UserCsvImportController.php, line 167

Class

UserCsvImportController
Provides methods to import CSV files and convert to users.

Namespace

Drupal\user_csv_import\Controller

Code

private static function usernameExists($username) {
  return \Drupal::entityQuery('user')
    ->condition('name', $username)
    ->execute();
}