You are here

public function UserManager::createProfile in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createProfile()
  2. 8.2 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createProfile()
  3. 8.3 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createProfile()
  4. 8.4 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createProfile()
  5. 8.5 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createProfile()
  6. 8.6 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createProfile()
  7. 8.7 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createProfile()
  8. 8.8 modules/custom/social_auth_extra/src/UserManager.php \Drupal\social_auth_extra\UserManager::createProfile()

Creates object of a new profile.

Parameters

array $values: Additional fields to save in the created profile.

Return value

\Drupal\Core\Entity\EntityInterface Object of a new user profile.

Overrides UserManagerInterface::createProfile

File

modules/custom/social_auth_extra/src/UserManager.php, line 97

Class

UserManager
Class UserManager.

Namespace

Drupal\social_auth_extra

Code

public function createProfile(array $values = []) {
  $values = array_merge([
    'uid' => $this->account ? $this->account
      ->id() : NULL,
    'type' => $this->profileType,
  ], $values);
  $this->profile = $this->entityTypeManager
    ->getStorage('profile')
    ->create($values);
  return $this->profile;
}