Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Member Functions | List of all members
FacebookService Class Reference
Inheritance diagram for FacebookService:
FacebookOAuthService IUserFields EOAuth2Service EAuthServiceBase IAuthService IAuthService

Public Member Functions

 getName ()
 getEmail ()
 getError ()

Protected Member Functions

 fetchAttributes ()
- Protected Member Functions inherited from FacebookOAuthService
 getCodeUrl ($redirect_uri)
 getTokenUrl ($code)
 getAccessToken ($code)
 saveAccessToken ($token)
 fetchJsonError ($json)
- Protected Member Functions inherited from EOAuth2Service
 restoreAccessToken ()
- Protected Member Functions inherited from EAuthServiceBase
 makeRequest ($url, $options=array(), $parseJson=true)
 initRequest ($url, $options=array())
 parseJson ($response)
 getStateKeyPrefix ()
 setState ($key, $value, $defaultValue=null)
 hasState ($key)
 getState ($key, $defaultValue=null)
 _fetchAttributes ()

Additional Inherited Members

- Protected Attributes inherited from FacebookOAuthService
 $name = 'facebook'
 $title = 'Facebook'
 $type = 'OAuth'
 $jsArguments = array('popup' => array('width' => 585, 'height' => 290))
 $client_id = ''
 $client_secret = ''
 $scope = ''
 $providerOptions

Detailed Description

Definition at line 17 of file FacebookService.php.

Member Function Documentation

FacebookService::fetchAttributes ( )
protected

Fetch attributes array.

Returns
boolean whether the attributes was successfully fetched.

Reimplemented from FacebookOAuthService.

Definition at line 19 of file FacebookService.php.

References EOAuth2Service\makeSignedRequest().

{
$info = (object) $this->makeSignedRequest('https://graph.facebook.com/me');
$this->attributes['id'] = $info->id;
$this->attributes['name'] = $info->first_name.'_'.$info->last_name;
$this->attributes['url'] = $info->link;
$this->attributes['email'] = $info->email;
$this->attributes['firstname'] = $info->first_name;
$this->attributes['lastname'] = $info->last_name;
$this->attributes['gender'] = $info->gender == 'male' ? 'M' : 'F';
}

The documentation for this class was generated from the following file: