Class humhub\modules\user\authclient\Collection

Inheritancehumhub\modules\user\authclient\Collection » yii\base\Component
Available since version1.1

Extended AuthClient collection with event support

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
createClient() Creates auth client instance from its array configuration. humhub\modules\user\authclient\Collection
getDefaultClients() Returns the configuration of default auth clients humhub\modules\user\authclient\Collection

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_AFTER_CLIENTS_SET \humhub\modules\user\authclient\Event An event raised after the clients are set. humhub\modules\user\authclient\Collection
EVENT_BEFORE_CLIENTS_SET \humhub\modules\user\authclient\Event An event raised before the clients are set. humhub\modules\user\authclient\Collection

Method Details

createClient() protected method

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.

throws \yii\base\InvalidConfigException
getClient() public method

public \yii\authclient\ClientInterface getClient ( $id, $load true )
$id string

Service id.

$load boolean
return \yii\authclient\ClientInterface

Auth client instance.

throws \yii\base\InvalidConfigException
getClients() public method

public \yii\authclient\ClientInterface[] getClients ( $load true )
$load
return \yii\authclient\ClientInterface[]

List of auth clients.

getDefaultClients() protected method

Returns the configuration of default auth clients

protected array getDefaultClients ( )
return array

The default auth clients

hasClient() public method

Checks if client exists in the hub.

public boolean hasClient ( $id )
$id string

Client id.

return boolean

Whether client exist.

removeClient() public method

Removes client by id

public void removeClient ( $id )
$id string

Client id.

setClient() public method

Sets a client by id and config

public void setClient ( $id, $config )
$id string

Auth client id.

$config array|\yii\authclient\ClientInterface

Auth client instance configuration.

setClients() public method

public void setClients ( array $clients )
$clients array

List of auth clients

Event Details

EVENT_AFTER_CLIENTS_SET event of type \humhub\modules\user\authclient\Event

An event raised after the clients are set.

EVENT_BEFORE_CLIENTS_SET event of type \humhub\modules\user\authclient\Event

An event raised before the clients are set.