function _pmperson_migrate_check_if_username_exists in Drupal PM (Project Management) 8
Same name and namespace in other branches
- 7.3 pmperson/includes/pmperson.migrate.inc \_pmperson_migrate_check_if_username_exists()
- 7.2 pmperson/includes/pmperson.migrate.inc \_pmperson_migrate_check_if_username_exists()
Checks whether a given username exists.
1 call to _pmperson_migrate_check_if_username_exists()
- _pmperson_migrate_generate_unique_username in pmperson/
includes/ pmperson.migrate.inc - A custom function to generate unique username.
File
- pmperson/
includes/ pmperson.migrate.inc, line 506 - Migration functions for the PM Person module.
Code
function _pmperson_migrate_check_if_username_exists($username) {
$result = db_query('SELECT u.uid FROM {users} u WHERE name = :name', array(
':name' => $username,
));
if ($result) {
$number_of_rows = $result
->rowCount();
if ($number_of_rows > 0) {
return TRUE;
}
}
return FALSE;
}