PHP Class Webiny\Component\OAuth2\OAuth2User

This class is returned when you request user details form an OAuth2 server. This class standardizes the data that you get back because every OAuth2 server has its own user structure.
Afficher le fichier Open project: Webiny/Framework Class Usage Examples

Méthodes publiques

Свойство Type Description
$avatarUrl string
$email string
$firstName string
$gender integer
$lastName string
$lastUpdated integer
$profileId string
$profileUrl string
$serviceName integer
$username string

Méthodes publiques

Méthode Description
__construct ( string $username, string $email ) Base constructor.
getAvatarUrl ( ) : string Get the url to users avatar on the OAuth2 server.
getFirstName ( ) : string Get users first name.
getGender ( ) : string Get users gender.
getLastName ( ) : string Get users last name.
getLastUpdateTime ( ) : integer Get the date when user last updated his profile on the OAuth2 server.
getProfileId ( ) : string Get user profile id on the current OAuth2 server.
getProfileUrl ( ) : string Returns the url to users profile on the OAuth2 server.
getServiceName ( ) : string Returns the name of the current OAuth2 server (like facebook, linkedin etc.).
setAvatarUrl ( string $avatarUrl ) Set the url to users avatar on the current OAuth2 server.
setFirstName ( string $firstName ) Set users first name.
setGender ( $gender ) Set the gender of the user, can be 'male' or 'female'.
setLastName ( $lastName ) Set users last name.
setLastUpdateTime ( integer $timestamp ) Set the date when user last updated his profile on the OAuth2 server.
setProfileId ( string $id ) Set the id of user of the current OAuth2 server.
setProfileUrl ( string $profileUrl ) Set the url of users profile on the current OAuth2 server.
setServiceName ( string $serviceName ) Set the service name that user used to login (like facebook, linkedin etc.)

Method Details

__construct() public méthode

Base constructor.
public __construct ( string $username, string $email )
$username string Users username.
$email string Users email.

getAvatarUrl() public méthode

Get the url to users avatar on the OAuth2 server.
public getAvatarUrl ( ) : string
Résultat string

getFirstName() public méthode

Get users first name.
public getFirstName ( ) : string
Résultat string

getGender() public méthode

Get users gender.
public getGender ( ) : string
Résultat string

getLastName() public méthode

Get users last name.
public getLastName ( ) : string
Résultat string

getLastUpdateTime() public méthode

Get the date when user last updated his profile on the OAuth2 server.
public getLastUpdateTime ( ) : integer
Résultat integer Timestamp in milliseconds.

getProfileId() public méthode

Get user profile id on the current OAuth2 server.
public getProfileId ( ) : string
Résultat string

getProfileUrl() public méthode

Returns the url to users profile on the OAuth2 server.
public getProfileUrl ( ) : string
Résultat string

getServiceName() public méthode

Returns the name of the current OAuth2 server (like facebook, linkedin etc.).
public getServiceName ( ) : string
Résultat string

setAvatarUrl() public méthode

Set the url to users avatar on the current OAuth2 server.
public setAvatarUrl ( string $avatarUrl )
$avatarUrl string

setFirstName() public méthode

Set users first name.
public setFirstName ( string $firstName )
$firstName string

setGender() public méthode

Set the gender of the user, can be 'male' or 'female'.
public setGender ( $gender )
$gender

setLastName() public méthode

Set users last name.
public setLastName ( $lastName )
$lastName

setLastUpdateTime() public méthode

Set the date when user last updated his profile on the OAuth2 server.
public setLastUpdateTime ( integer $timestamp )
$timestamp integer Timestamp in milliseconds.

setProfileId() public méthode

Set the id of user of the current OAuth2 server.
public setProfileId ( string $id )
$id string

setProfileUrl() public méthode

Set the url of users profile on the current OAuth2 server.
public setProfileUrl ( string $profileUrl )
$profileUrl string

setServiceName() public méthode

Set the service name that user used to login (like facebook, linkedin etc.)
public setServiceName ( string $serviceName )
$serviceName string

Property Details

$avatarUrl public_oe property

public string $avatarUrl
Résultat string

$email public_oe property

public string $email
Résultat string

$firstName public_oe property

public string $firstName
Résultat string

$gender public_oe property

public int $gender
Résultat integer

$lastName public_oe property

public string $lastName
Résultat string

$lastUpdated public_oe property

public int $lastUpdated
Résultat integer

$profileId public_oe property

public string $profileId
Résultat string

$profileUrl public_oe property

public string $profileUrl
Résultat string

$serviceName public_oe property

public int $serviceName
Résultat integer

$username public_oe property

public string $username
Résultat string