BaseClient is a base Auth Client class.
See also yii\authclient\ClientInterface.
Property | Type | Description | Defined By |
---|---|---|---|
$behaviors | yii\base\Behavior[] | List of behaviors attached to this component | yii\base\Component |
$httpClient | yii\httpclient\Client | Internal HTTP client. | yii\authclient\BaseClient |
$id | string | Service id. | yii\authclient\BaseClient |
$name | string | Service name. | yii\authclient\BaseClient |
$normalizeUserAttributeMap | array | Normalize user attribute map. | yii\authclient\BaseClient |
$requestOptions | array | HTTP request options. | yii\authclient\BaseClient |
$stateStorage | yii\authclient\StateStorageInterface | Stage storage. | yii\authclient\BaseClient |
$title | string | Service title. | yii\authclient\BaseClient |
$userAttributes | array | List of user attributes | yii\authclient\BaseClient |
$viewOptions | array | View options in format: optionName => optionValue | yii\authclient\BaseClient |
Internal HTTP client.
public yii\httpclient\Client getHttpClient ( )
public void setHttpClient ( $httpClient )
Service id.
public string getId ( )
public void setId ( $id )
Service name.
public string getName ( )
public void setName ( $name )
Normalize user attribute map.
public array getNormalizeUserAttributeMap ( )
public void setNormalizeUserAttributeMap ( $normalizeUserAttributeMap )
HTTP request options.
public array getRequestOptions ( )
public void setRequestOptions ( array $options )
Stage storage.
public yii\authclient\StateStorageInterface getStateStorage ( )
public void setStateStorage ( $stateStorage )
Service title.
public string getTitle ( )
public void setTitle ( $title )
List of user attributes
public array getUserAttributes ( )
public void setUserAttributes ( $userAttributes )
View options in format: optionName => optionValue
public array getViewOptions ( )
public void setViewOptions ( $viewOptions )
Creates HTTP client instance from reference or configuration.
protected yii\httpclient\Client createHttpClient ( $reference ) | ||
---|---|---|
$reference | string|array |
Component name or array configuration. |
return | yii\httpclient\Client |
HTTP client instance. |
Creates HTTP request instance.
public yii\httpclient\Request createRequest ( ) | ||
---|---|---|
return | yii\httpclient\Request |
HTTP request instance. |
Generates service name.
protected string defaultName ( ) | ||
---|---|---|
return | string |
Service name. |
Returns the default $normalizeUserAttributeMap value.
Particular client may override this method in order to provide specific default map.
protected array defaultNormalizeUserAttributeMap ( ) | ||
---|---|---|
return | array |
Normalize attribute map. |
Returns default HTTP request options.
protected array defaultRequestOptions ( ) | ||
---|---|---|
return | array |
HTTP request options. |
Generates service title.
protected string defaultTitle ( ) | ||
---|---|---|
return | string |
Service title. |
Returns the default $viewOptions value.
Particular client may override this method in order to provide specific default view options.
protected array defaultViewOptions ( ) | ||
---|---|---|
return | array |
List of default $viewOptions |
Returns HTTP client.
public yii\httpclient\Client getHttpClient ( ) | ||
---|---|---|
return | yii\httpclient\Client |
Internal HTTP client. |
public string getId ( ) | ||
---|---|---|
return | string |
Service id |
public string getName ( ) | ||
---|---|---|
return | string |
Service name. |
public array getNormalizeUserAttributeMap ( ) | ||
---|---|---|
return | array |
Normalize user attribute map. |
public array getRequestOptions ( ) | ||
---|---|---|
return | array |
HTTP request options. |
Returns persistent state value.
protected mixed getState ( $key ) | ||
---|---|---|
$key | string |
State key. |
return | mixed |
State value. |
Returns session key prefix, which is used to store internal states.
protected string getStateKeyPrefix ( ) | ||
---|---|---|
return | string |
Session key prefix. |
public yii\authclient\StateStorageInterface getStateStorage ( ) | ||
---|---|---|
return | yii\authclient\StateStorageInterface |
Stage storage. |
public string getTitle ( ) | ||
---|---|---|
return | string |
Service title. |
public array getUserAttributes ( ) | ||
---|---|---|
return | array |
List of user attributes |
public array getViewOptions ( ) | ||
---|---|---|
return | array |
View options in format: optionName => optionValue |
Initializes authenticated user attributes.
protected abstract array initUserAttributes ( ) | ||
---|---|---|
return | array |
Auth user attributes. |
Normalize given user attributes according to $normalizeUserAttributeMap.
protected array normalizeUserAttributes ( $attributes ) | ||
---|---|---|
$attributes | array |
Raw attributes. |
return | array |
Normalized attributes. |
throws | yii\base\InvalidConfigException |
on incorrect normalize attribute map. |
Removes persistent state value.
protected boolean removeState ( $key ) | ||
---|---|---|
$key | string |
State key. |
return | boolean |
Success. |
Sets HTTP client to be used.
public void setHttpClient ( $httpClient ) | ||
---|---|---|
$httpClient | array|yii\httpclient\Client |
Internal HTTP client. |
public void setId ( $id ) | ||
---|---|---|
$id | string |
Service id. |
public void setName ( $name ) | ||
---|---|---|
$name | string |
Service name. |
public void setNormalizeUserAttributeMap ( $normalizeUserAttributeMap ) | ||
---|---|---|
$normalizeUserAttributeMap | array |
Normalize user attribute map. |
public void setRequestOptions ( array $options ) | ||
---|---|---|
$options | array |
HTTP request options. |
Sets persistent state.
protected $this setState ( $key, $value ) | ||
---|---|---|
$key | string |
State key. |
$value | mixed |
State value |
return | $this |
The object itself |
public void setStateStorage ( $stateStorage ) | ||
---|---|---|
$stateStorage | yii\authclient\StateStorageInterface|array|string |
Stage storage to be used. |
public void setTitle ( $title ) | ||
---|---|---|
$title | string |
Service title. |
public void setUserAttributes ( $userAttributes ) | ||
---|---|---|
$userAttributes | array |
List of user attributes |
public void setViewOptions ( $viewOptions ) | ||
---|---|---|
$viewOptions | array |
View options in format: optionName => optionValue |
© 2008–2017 by Yii Software LLC
Licensed under the three clause BSD license.
http://www.yiiframework.com/doc-2.0/yii-authclient-baseclient.html