PHP Class yii\authclient\BaseClient

See also: ClientInterface
Since: 2.0
Author: Paul Klimov ([email protected])
Inheritance: extends yii\base\Component, implements yii\authclient\ClientInterface
Afficher le fichier Open project: yiisoft/yii2-authclient Class Usage Examples

Méthodes publiques

Méthode Description
createRequest ( ) : Request Creates HTTP request instance.
getHttpClient ( ) : Client Returns HTTP client.
getId ( ) : string
getName ( ) : string
getNormalizeUserAttributeMap ( ) : array
getRequestOptions ( ) : array
getStateStorage ( ) : yii\authclient\StateStorageInterface
getTitle ( ) : string
getUserAttributes ( ) : array
getViewOptions ( ) : array
setHttpClient ( array | Client $httpClient ) Sets HTTP client to be used.
setId ( string $id )
setName ( string $name )
setNormalizeUserAttributeMap ( array $normalizeUserAttributeMap )
setRequestOptions ( array $options )
setStateStorage ( yii\authclient\StateStorageInterface | array | string $stateStorage )
setTitle ( string $title )
setUserAttributes ( array $userAttributes )
setViewOptions ( array $viewOptions )

Méthodes protégées

Méthode Description
createHttpClient ( string | array $reference ) : Client Creates HTTP client instance from reference or configuration.
defaultName ( ) : string Generates service name.
defaultNormalizeUserAttributeMap ( ) : array Returns the default [[normalizeUserAttributeMap]] value.
defaultRequestOptions ( ) : array Returns default HTTP request options.
defaultTitle ( ) : string Generates service title.
defaultViewOptions ( ) : array Returns the default [[viewOptions]] value.
getState ( string $key ) : mixed Returns persistent state value.
getStateKeyPrefix ( ) : string Returns session key prefix, which is used to store internal states.
initUserAttributes ( ) : array Initializes authenticated user attributes.
normalizeUserAttributes ( array $attributes ) : array Normalize given user attributes according to [[normalizeUserAttributeMap]].
removeState ( string $key ) : boolean Removes persistent state value.
setState ( string $key, mixed $value ) Sets persistent state.

Method Details

createHttpClient() protected méthode

Creates HTTP client instance from reference or configuration.
Since: 2.1
protected createHttpClient ( string | array $reference ) : Client
$reference string | array component name or array configuration.
Résultat yii\httpclient\Client HTTP client instance.

createRequest() public méthode

Creates HTTP request instance.
Since: 2.1
public createRequest ( ) : Request
Résultat yii\httpclient\Request HTTP request instance.

defaultName() protected méthode

Generates service name.
protected defaultName ( ) : string
Résultat string service name.

defaultNormalizeUserAttributeMap() protected méthode

Particular client may override this method in order to provide specific default map.
protected defaultNormalizeUserAttributeMap ( ) : array
Résultat array normalize attribute map.

defaultRequestOptions() protected méthode

Returns default HTTP request options.
Since: 2.1
protected defaultRequestOptions ( ) : array
Résultat array HTTP request options.

defaultTitle() protected méthode

Generates service title.
protected defaultTitle ( ) : string
Résultat string service title.

defaultViewOptions() protected méthode

Particular client may override this method in order to provide specific default view options.
protected defaultViewOptions ( ) : array
Résultat array list of default [[viewOptions]]

getHttpClient() public méthode

Returns HTTP client.
Since: 2.1
public getHttpClient ( ) : Client
Résultat yii\httpclient\Client internal HTTP client.

getId() public méthode

public getId ( ) : string
Résultat string service id

getName() public méthode

public getName ( ) : string
Résultat string service name.

getNormalizeUserAttributeMap() public méthode

public getNormalizeUserAttributeMap ( ) : array
Résultat array normalize user attribute map.

getRequestOptions() public méthode

Since: 2.1
public getRequestOptions ( ) : array
Résultat array HTTP request options.

getState() protected méthode

Returns persistent state value.
protected getState ( string $key ) : mixed
$key string state key.
Résultat mixed state value.

getStateKeyPrefix() protected méthode

Returns session key prefix, which is used to store internal states.
protected getStateKeyPrefix ( ) : string
Résultat string session key prefix.

getStateStorage() public méthode

public getStateStorage ( ) : yii\authclient\StateStorageInterface
Résultat yii\authclient\StateStorageInterface stage storage.

getTitle() public méthode

public getTitle ( ) : string
Résultat string service title.

getUserAttributes() public méthode

public getUserAttributes ( ) : array
Résultat array list of user attributes

getViewOptions() public méthode

public getViewOptions ( ) : array
Résultat array view options in format: optionName => optionValue

initUserAttributes() abstract protected méthode

Initializes authenticated user attributes.
abstract protected initUserAttributes ( ) : array
Résultat array auth user attributes.

normalizeUserAttributes() protected méthode

Normalize given user attributes according to [[normalizeUserAttributeMap]].
protected normalizeUserAttributes ( array $attributes ) : array
$attributes array raw attributes.
Résultat array normalized attributes.

removeState() protected méthode

Removes persistent state value.
protected removeState ( string $key ) : boolean
$key string state key.
Résultat boolean success.

setHttpClient() public méthode

Sets HTTP client to be used.
Since: 2.1
public setHttpClient ( array | Client $httpClient )
$httpClient array | yii\httpclient\Client internal HTTP client.

setId() public méthode

public setId ( string $id )
$id string service id.

setName() public méthode

public setName ( string $name )
$name string service name.

setNormalizeUserAttributeMap() public méthode

public setNormalizeUserAttributeMap ( array $normalizeUserAttributeMap )
$normalizeUserAttributeMap array normalize user attribute map.

setRequestOptions() public méthode

Since: 2.1
public setRequestOptions ( array $options )
$options array HTTP request options.

setState() protected méthode

Sets persistent state.
protected setState ( string $key, mixed $value )
$key string state key.
$value mixed state value

setStateStorage() public méthode

public setStateStorage ( yii\authclient\StateStorageInterface | array | string $stateStorage )
$stateStorage yii\authclient\StateStorageInterface | array | string stage storage to be used.

setTitle() public méthode

public setTitle ( string $title )
$title string service title.

setUserAttributes() public méthode

public setUserAttributes ( array $userAttributes )
$userAttributes array list of user attributes

setViewOptions() public méthode

public setViewOptions ( array $viewOptions )
$viewOptions array view options in format: optionName => optionValue