yii\authclient\OAuthToken - Yii2 类参考手册

Class yii\authclient\OAuthToken

Inheritanceyii\authclient\OAuthToken » yii\base\BaseObject
Implementsyii\base\Configurable
Available since version2.0

Token represents OAuth token.

Public Properties

隐藏继承的属性 Hide inherited properties

属性Property类型 Type简介 Description定义在 Defined By
$createTimestamp integer Object creation timestamp. yii\authclient\OAuthToken
$expireDuration string Token expiration duration. yii\authclient\OAuthToken
$expireDurationParamKey string Expire duration param key. yii\authclient\OAuthToken
$isExpired boolean Is token expired. yii\authclient\OAuthToken
$isValid boolean Is token valid. yii\authclient\OAuthToken
$params array yii\authclient\OAuthToken
$token string Token value. yii\authclient\OAuthToken
$tokenParamKey string Key in $params array, which stores token key. yii\authclient\OAuthToken
$tokenSecret string Token secret. yii\authclient\OAuthToken
$tokenSecretParamKey string Key in $params array, which stores token secret key. yii\authclient\OAuthToken

Public Methods

隐藏继承的方法 Hide inherited methods

方法 Method简介 Description定义在 Defined By
__call() Calls the named method which is not a class method. yii\base\BaseObject
__construct() Constructor. yii\base\BaseObject
__get() Returns the value of an object property. yii\base\BaseObject
__isset() Checks if a property is set, i.e. defined and not null. yii\base\BaseObject
__set() Sets value of an object property. yii\base\BaseObject
__unset() Sets an object property to null. yii\base\BaseObject
canGetProperty() Returns a value indicating whether a property can be read. yii\base\BaseObject
canSetProperty() Returns a value indicating whether a property can be set. yii\base\BaseObject
className() Returns the fully qualified name of this class. yii\base\BaseObject
getExpireDuration() Returns the token expiration duration. yii\authclient\OAuthToken
getExpireDurationParamKey() yii\authclient\OAuthToken
getIsExpired() Checks if token has expired. yii\authclient\OAuthToken
getIsValid() Checks if token is valid. yii\authclient\OAuthToken
getParam() Returns param by name. yii\authclient\OAuthToken
getParams() yii\authclient\OAuthToken
getToken() Returns token value. yii\authclient\OAuthToken
getTokenSecret() Returns the token secret value. yii\authclient\OAuthToken
hasMethod() Returns a value indicating whether a method is defined. yii\base\BaseObject
hasProperty() Returns a value indicating whether a property is defined. yii\base\BaseObject
init() Initializes the object. yii\authclient\OAuthToken
setExpireDuration() Sets token expire duration. yii\authclient\OAuthToken
setExpireDurationParamKey() yii\authclient\OAuthToken
setParam() Sets param by name. yii\authclient\OAuthToken
setParams() yii\authclient\OAuthToken
setToken() Sets token value. yii\authclient\OAuthToken
setTokenSecret() Sets the token secret value. yii\authclient\OAuthToken

Protected Methods

隐藏继承的方法 Hide inherited methods

方法 Method简介 Description定义在 Defined By
defaultExpireDurationParamKey() Fetches default expire duration param key. yii\authclient\OAuthToken

属性详情 Property Details

$createTimestamp public property

Object creation timestamp.

public integer $createTimestamp null
$expireDuration public property

Token expiration duration.

public integer getExpireDuration ( )
public void setExpireDuration ( $expireDuration )
$expireDurationParamKey public property

Expire duration param key.

public string getExpireDurationParamKey ( )
public void setExpireDurationParamKey ( $expireDurationParamKey )
$isExpired public read-only property

Is token expired.

$isValid public read-only property

Is token valid.

public boolean getIsValid ( )
$params public property
public array getParams ( )
public void setParams ( array $params )
$token public property

Token value.

public string getToken ( )
public $this setToken ( $token )
$tokenParamKey public property

Key in $params array, which stores token key.

public string $tokenParamKey 'oauth_token'
$tokenSecret public property

Token secret.

public string getTokenSecret ( )
public void setTokenSecret ( $tokenSecret )
$tokenSecretParamKey public property

Key in $params array, which stores token secret key.

public string $tokenSecretParamKey 'oauth_token_secret'

方法详情 Method Details

defaultExpireDurationParamKey() protected method

Fetches default expire duration param key.

protected string defaultExpireDurationParamKey ( )
return string

Expire duration param key.

getExpireDuration() public method

Returns the token expiration duration.

public integer getExpireDuration ( )
return integer

Token expiration duration.

getExpireDurationParamKey() public method

public string getExpireDurationParamKey ( )
return string

Expire duration param key.

getIsExpired() public method

Checks if token has expired.

public boolean getIsExpired ( )
return boolean

Is token expired.

getIsValid() public method

Checks if token is valid.

public boolean getIsValid ( )
return boolean

Is token valid.

getParam() public method

Returns param by name.

public mixed getParam ( $name )
$name string

Param name.

return mixed

Param value.

getParams() public method

public array getParams ( )
getToken() public method

Returns token value.

public string getToken ( )
return string

Token value.

getTokenSecret() public method

Returns the token secret value.

public string getTokenSecret ( )
return string

Token secret value.

init() public method

Initializes the object.

This method is invoked at the end of the constructor after the object is initialized with the given configuration.

public void init ( )
setExpireDuration() public method

Sets token expire duration.

public void setExpireDuration ( $expireDuration )
$expireDuration string

Token expiration duration.

setExpireDurationParamKey() public method

public void setExpireDurationParamKey ( $expireDurationParamKey )
$expireDurationParamKey string

Expire duration param key.

setParam() public method

Sets param by name.

public void setParam ( $name, $value )
$name string

Param name.

$value mixed

Param value,

setParams() public method

public void setParams ( array $params )
$params array
setToken() public method

Sets token value.

public $this setToken ( $token )
$token string

Token value.

return $this

The object itself

setTokenSecret() public method

Sets the token secret value.

public void setTokenSecret ( $tokenSecret )
$tokenSecret string

Token secret.