PHP Class yii\authclient\Collection

Example application configuration: php 'components' => [ 'authClientCollection' => [ 'class' => 'yii\authclient\Collection', 'clients' => [ 'google' => [ 'class' => 'yii\authclient\clients\Google', 'clientId' => 'google_client_id', 'clientSecret' => 'google_client_secret', ], 'facebook' => [ 'class' => 'yii\authclient\clients\Facebook', 'clientId' => 'facebook_client_id', 'clientSecret' => 'facebook_client_secret', ], ], ] ... ]
Since: 2.0
Author: Paul Klimov ([email protected])
Inheritance: extends yii\base\Component
Datei anzeigen Open project: yiisoft/yii2-authclient Class Usage Examples

Public Properties

Property Type Description
$httpClient HTTP client instance or configuration for the [[clients]]. If set, this value will be passed as 'httpClient' config option while instantiating particular client object. This option is useful for adjusting HTTP client configuration for the entire list of auth clients.

Public Methods

Method Description
getClient ( string $id ) : yii\authclient\ClientInterface
getClients ( ) : yii\authclient\ClientInterface[]
hasClient ( string $id ) : boolean Checks if client exists in the hub.
setClients ( array $clients )

Protected Methods

Method Description
createClient ( string $id, array $config ) : yii\authclient\ClientInterface Creates auth client instance from its array configuration.

Method Details

createClient() protected method

Creates auth client instance from its array configuration.
protected createClient ( string $id, array $config ) : yii\authclient\ClientInterface
$id string auth client id.
$config array auth client instance configuration.
return yii\authclient\ClientInterface auth client instance.

getClient() public method

public getClient ( string $id ) : yii\authclient\ClientInterface
$id string service id.
return yii\authclient\ClientInterface auth client instance.

getClients() public method

public getClients ( ) : yii\authclient\ClientInterface[]
return yii\authclient\ClientInterface[] list of auth clients.

hasClient() public method

Checks if client exists in the hub.
public hasClient ( string $id ) : boolean
$id string client id.
return boolean whether client exist.

setClients() public method

public setClients ( array $clients )
$clients array list of auth clients

Property Details

$httpClient public_oe property

HTTP client instance or configuration for the [[clients]]. If set, this value will be passed as 'httpClient' config option while instantiating particular client object. This option is useful for adjusting HTTP client configuration for the entire list of auth clients.
public $httpClient