You are here

public function LinkedInAuthManager::getFirstName in Open Social 8.9

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

Returns first name on a social network if it possible.

Return value

string|null The first name on a social network or null.

Overrides AuthManagerInterface::getFirstName

File

modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php, line 132

Class

LinkedInAuthManager
Class LinkedInAuthManager.

Namespace

Drupal\social_auth_linkedin

Code

public function getFirstName() {
  if (!empty($this->profile['basic_information']['firstName'])) {
    return array_values($this->profile['basic_information']['firstName']['localized'])[0];
  }
}