public function LinkedInAuthManager::getProfile in Open Social 8.9
Same name and namespace in other branches
- 8 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfile()
- 8.2 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfile()
- 8.3 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfile()
- 8.4 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfile()
- 8.5 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfile()
- 8.6 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfile()
- 8.7 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfile()
- 8.8 modules/custom/social_auth_linkedin/src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getProfile()
Returns object of a user profile.
Return value
mixed Returns the profile.
Overrides AuthManagerInterface::getProfile
File
- modules/
custom/ social_auth_linkedin/ src/ LinkedInAuthManager.php, line 86
Class
- LinkedInAuthManager
- Class LinkedInAuthManager.
Namespace
Drupal\social_auth_linkedinCode
public function getProfile() {
if (!$this->profile) {
// Add basic profile information.
if (($profile = $this->sdk
->get('me', [
'fields' => 'id,firstName,lastName',
])) && !isset($profile['errorCode'])) {
$this->profile['id'] = $profile['id'];
$this->profile['basic_information'] = $profile;
}
if (($profile = $this->sdk
->get('me', [
'projection' => '(id,profilePicture(displayImage~:playableStreams))',
])) && !isset($profile['errorCode'])) {
$this->profile['profile_picture'] = $profile;
}
if (($profile = $this->sdk
->get('emailAddress', [
'q' => 'members',
'projection' => '(elements*(handle~))',
])) && !isset($profile['errorCode'])) {
$this->profile['email_information'] = $profile;
}
}
return $this->profile;
}