public function UserManager::createAccount in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createAccount()
- 8 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createAccount()
- 8.2 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createAccount()
- 8.3 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createAccount()
- 8.4 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createAccount()
- 8.5 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createAccount()
- 8.6 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createAccount()
- 8.7 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createAccount()
Creates object of a new account.
Parameters
array $values: Additional fields to save in the created account.
Return value
\Drupal\Core\Entity\EntityInterface Object of a new user account.
Overrides UserManagerInterface::createAccount
File
- modules/
custom/ social_auth_extra/ src/ UserManager.php, line 75
Class
- UserManager
- Class UserManager.
Namespace
Drupal\social_auth_extraCode
public function createAccount(array $values = []) {
$langcode = $this->languageManager
->getCurrentLanguage()
->getId();
$values = array_merge([
'name' => '',
'mail' => '',
'init' => '',
'pass' => NULL,
'status' => 1,
'langcode' => $langcode,
'preferred_langcode' => $langcode,
'preferred_admin_langcode' => $langcode,
], $values);
$this->account = $this->entityTypeManager
->getStorage('user')
->create($values);
return $this->account;
}