PHP Класс Hybrid_Provider_Adapter

Basically Hybrid_Provider_Adapter will create a bridge from your php application to the provider api. Hybrid_Auth will automatically load Hybrid_Provider_Adapter and create an instance of it for each authenticated provider.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$adapter Hybrid_Provider_Model Provider adapter instance
$config array Provider adapter specific config
$id mixed Provider ID (or unique name)
$params array Provider adapter extra parameters
$wrapper string Provider adapter wrapper path

Открытые методы

Метод Описание
__call ( string $name, array $arguments ) : mixed Call adapter methods defined in the adapter model: getUserProfile() getUserContacts() getUserActivity() setUserStatus()
api ( ) : stdClass Naive getter of the current connected IDp API client
factory ( string $id, array $params = [] ) : Hybrid_Provider_Adapter Create a new adapter switch IDp name or ID
getAccessToken ( ) : array If the user is connected, then return the access_token and access_token_secret if the provider api use oauth
getConfigById ( string $id ) : mixed Return the provider config by id
getProviderCiId ( string $id ) : mixed Return the provider config by id; case insensitive
isUserConnected ( ) : boolean Return true if the user is connected to the current provider
login ( ) : void Hybrid_Provider_Adapter::login(), prepare the user session and the authentication request for index.php
logout ( ) : boolean Let hybridauth forget all about the user for the current provider
returnToCallbackUrl ( ) : void Redirect the user to hauth_return_to (the callback url)

Описание методов

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

Call adapter methods defined in the adapter model: getUserProfile() getUserContacts() getUserActivity() setUserStatus()
public __call ( string $name, array $arguments ) : mixed
$name string Method name
$arguments array Call arguments
Результат mixed

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

Naive getter of the current connected IDp API client
public api ( ) : stdClass
Результат stdClass

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

Create a new adapter switch IDp name or ID
public factory ( string $id, array $params = [] ) : Hybrid_Provider_Adapter
$id string The id or name of the IDp
$params array (optional) required parameters by the adapter
Результат Hybrid_Provider_Adapter

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

array( 'access_token' => '', 'access_token_secret' => '', 'refresh_token' => '', 'expires_in' => '', 'expires_at' => '', )
public getAccessToken ( ) : array
Результат array

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

Return the provider config by id
public getConfigById ( string $id ) : mixed
$id string Config key
Результат mixed

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

Return the provider config by id; case insensitive
public getProviderCiId ( string $id ) : mixed
$id string Provider id
Результат mixed

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

Return true if the user is connected to the current provider
public isUserConnected ( ) : boolean
Результат boolean

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

Hybrid_Provider_Adapter::login(), prepare the user session and the authentication request for index.php
public login ( ) : void
Результат void

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

Let hybridauth forget all about the user for the current provider
public logout ( ) : boolean
Результат boolean

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

Redirect the user to hauth_return_to (the callback url)
public returnToCallbackUrl ( ) : void
Результат void

Описание свойств

$adapter публичное свойство

Provider adapter instance
public Hybrid_Provider_Model $adapter
Результат Hybrid_Provider_Model

$config публичное свойство

Provider adapter specific config
public array $config
Результат array

$id публичное свойство

Provider ID (or unique name)
public mixed $id
Результат mixed

$params публичное свойство

Provider adapter extra parameters
public array $params
Результат array

$wrapper публичное свойство

Provider adapter wrapper path
public string $wrapper
Результат string