You are here

public function LinkedInAuthManager::getProfilePicture 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::getProfilePicture()
  2. 8.2 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfilePicture()
  3. 8.3 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfilePicture()
  4. 8.4 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfilePicture()
  5. 8.5 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfilePicture()
  6. 8.6 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfilePicture()
  7. 8.7 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfilePicture()
  8. 8.8 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfilePicture()

Returns URL of a profile picture.

Return value

string|null Absolute URL to a picture or Null if picture is not set.

Overrides AuthManagerInterface::getProfilePicture

File

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

Class

LinkedInAuthManager
Class LinkedInAuthManager.

Namespace

Drupal\social_auth_linkedin

Code

public function getProfilePicture() {
  if (!empty($this->profile['profile_picture']['profilePicture']['displayImage~']['elements'])) {
    $profile_picture = end($this->profile['profile_picture']['profilePicture']['displayImage~']['elements']);
    return $profile_picture['identifiers'][0]['identifier'];
  }
}