Class yii\authclient\Collection
Inheritance | yii\authclient\Collection » yii\base\Component |
---|---|
Available since version | 2.0 |
Collection is a storage for all auth clients in the application.
Example application configuration:
'components' => [
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [
'google' => [
'class' => 'yii\authclient\clients\GoogleOpenId'
],
'facebook' => [
'class' => 'yii\authclient\clients\Facebook',
'clientId' => 'facebook_client_id',
'clientSecret' => 'facebook_client_secret',
],
],
]
...
]
Public Methods
Method | Description | Defined By |
---|---|---|
getClient() | yii\authclient\Collection | |
getClients() | yii\authclient\Collection | |
hasClient() | Checks if client exists in the hub. | yii\authclient\Collection |
setClients() | yii\authclient\Collection |
Protected Methods
Method | Description | Defined By |
---|---|---|
createClient() | Creates auth client instance from its array configuration. | yii\authclient\Collection |
Method Details
Creates auth client instance from its array configuration.
protected yii\authclient\ClientInterface createClient ( $id, $config ) | ||
$id | string | Auth client id. |
$config | array | Auth client instance configuration. |
return | yii\authclient\ClientInterface | Auth client instance. |
---|
public yii\authclient\ClientInterface getClient ( $id ) | ||
$id | string | Service id. |
return | yii\authclient\ClientInterface | Auth client instance. |
---|---|---|
throws | \yii\base\InvalidParamException | on non existing client request. |
public yii\authclient\ClientInterface[] getClients ( ) | ||
return | yii\authclient\ClientInterface[] | List of auth clients. |
---|
Checks if client exists in the hub.
public boolean hasClient ( $id ) | ||
$id | string | Client id. |
return | boolean | Whether client exist. |
---|
public void setClients ( array $clients ) | ||
$clients | array | List of auth clients |