public function AccessStorage::getUserIdByName in Permissions by Term 8
Same name and namespace in other branches
- 8.2 src/Service/AccessStorage.php \Drupal\permissions_by_term\Service\AccessStorage::getUserIdByName()
Parameters
string $sUsername:
Return value
int
File
- src/
Service/ AccessStorage.php, line 210
Class
- AccessStorage
- Class AccessStorage.
Namespace
Drupal\permissions_by_term\ServiceCode
public function getUserIdByName($sUsername) {
return $this->database
->select('users_field_data', 'ufd')
->condition('name', $sUsername)
->fields('ufd', [
'uid',
])
->execute()
->fetchAssoc();
}