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.
Show file Open project: Webiny/Framework Class Usage Examples

Public Properties

Property Type Description
$avatarUrl string
$email string
$firstName string
$gender integer
$lastName string
$lastUpdated integer
$profileId string
$profileUrl string
$serviceName integer
$username string

Public Methods

Method 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 method

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

getAvatarUrl() public method

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

getFirstName() public method

Get users first name.
public getFirstName ( ) : string
return string

getGender() public method

Get users gender.
public getGender ( ) : string
return string

getLastName() public method

Get users last name.
public getLastName ( ) : string
return string

getLastUpdateTime() public method

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

getProfileId() public method

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

getProfileUrl() public method

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

getServiceName() public method

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

setAvatarUrl() public method

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

setFirstName() public method

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

setGender() public method

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

setLastName() public method

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

setLastUpdateTime() public method

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

setProfileId() public method

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

setProfileUrl() public method

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

setServiceName() public method

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

Property Details

$avatarUrl public property

public string $avatarUrl
return string

$email public property

public string $email
return string

$firstName public property

public string $firstName
return string

$gender public property

public int $gender
return integer

$lastName public property

public string $lastName
return string

$lastUpdated public property

public int $lastUpdated
return integer

$profileId public property

public string $profileId
return string

$profileUrl public property

public string $profileUrl
return string

$serviceName public property

public int $serviceName
return integer

$username public property

public string $username
return string