yii\authclient\Collection::getClient PHP Метод

getClient() публичный Метод

public getClient ( string $id ) : yii\authclient\ClientInterface
$id string service id.
Результат yii\authclient\ClientInterface auth client instance.
    public function getClient($id)
    {
        if (!array_key_exists($id, $this->_clients)) {
            throw new InvalidParamException("Unknown auth client '{$id}'.");
        }
        if (!is_object($this->_clients[$id])) {
            $this->_clients[$id] = $this->createClient($id, $this->_clients[$id]);
        }
        return $this->_clients[$id];
    }

Usage Example

Пример #1
0
 /**
  * Gets first client by default.
  */
 public function getClient($id = null)
 {
     if ($id === null) {
         list($id, $dummy) = each($this->getClients());
     }
     return parent::getClient($id);
 }
All Usage Examples Of yii\authclient\Collection::getClient