PHP Класс Hybrid_Provider_Model

Basically, each provider adapter has to define at least 4 methods: Hybrid_Providers_{provider_name}::initialize() Hybrid_Providers_{provider_name}::loginBegin() Hybrid_Providers_{provider_name}::loginFinish() Hybrid_Providers_{provider_name}::getUserProfile() HybridAuth also come with three others models Class Hybrid_Provider_Model_OpenID for providers that uses the OpenID 1 and 2 protocol. Class Hybrid_Provider_Model_OAuth1 for providers that uses the OAuth 1 protocol. Class Hybrid_Provider_Model_OAuth2 for providers that uses the OAuth 2 protocol.
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$api stdClass The provider api client (optional)
$compressed stdClass Model should use "gzip,deflate" for CURLOPT_ENCODING
$config array Specific provider adapter config
$endpoint string Endpoint URL for that provider
$params array Provider extra parameters
$providerId mixed IDp ID (or unique name)
$useSafeUrls boolean Enable this to replace '.' with '_' characters in the callback urls
$user Hybrid_User Hybrid_User obj, represents the current loggedin user

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

Метод Описание
__construct ( mixed $providerId, array $config, array $params = null ) Common providers adapter constructor
clearTokens ( ) : void Clear all existent tokens for this provider
deleteToken ( $token ) : void Delete a stored token
getUserActivity ( $stream ) : Hybrid_User_Activity[] Return the user activity stream
getUserContacts ( ) : Hybrid_User_Contact[] Load the current logged in user contacts list from the IDp api client
getUserProfile ( ) : Hybrid_User_Profile Grab the user profile from the IDp api client
getUserStatus ( $statusid ) : mixed Return the user status
isUserConnected ( ) : boolean Return true if the user is connected to the current provider
logout ( ) : boolean Generic logout, just erase current provider adapter stored data to let Hybrid_Auth all forget about it
setUserConnected ( ) : void Set user to connected
setUserStatus ( $status ) : mixed Set user status
setUserUnconnected ( ) : void Set user to unconnected
token ( $token, $value = null ) : string Get or set a token

Защищенные методы

Метод Описание
initialize ( ) : void IDp wrappers initializer
loginBegin ( ) : void Begin login
loginFinish ( ) : void Finish login

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

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

Common providers adapter constructor
public __construct ( mixed $providerId, array $config, array $params = null )
$providerId mixed Provider ID
$config array Provider adapter config
$params array Provider extra params

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

Clear all existent tokens for this provider
public clearTokens ( ) : void
Результат void

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

Delete a stored token
public deleteToken ( $token ) : void
Результат void

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

Return the user activity stream
public getUserActivity ( $stream ) : Hybrid_User_Activity[]
Результат Hybrid_User_Activity[]

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

Load the current logged in user contacts list from the IDp api client
public getUserContacts ( ) : Hybrid_User_Contact[]
Результат Hybrid_User_Contact[]

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

Grab the user profile from the IDp api client
public getUserProfile ( ) : Hybrid_User_Profile
Результат Hybrid_User_Profile

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

Return the user status
public getUserStatus ( $statusid ) : mixed
Результат mixed Provider response

initialize() абстрактный защищенный Метод

The main job of wrappers initializer is to performs (depend on the IDp api client it self): - include some libs needed by this provider, - check IDp key and secret, - set some needed parameters (stored in $this->params) by this IDp api client - create and setup an instance of the IDp api client on $this->api
abstract protected initialize ( ) : void
Результат void

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

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

loginBegin() абстрактный защищенный Метод

Begin login
abstract protected loginBegin ( ) : void
Результат void

loginFinish() абстрактный защищенный Метод

Finish login
abstract protected loginFinish ( ) : void
Результат void

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

Generic logout, just erase current provider adapter stored data to let Hybrid_Auth all forget about it
public logout ( ) : boolean
Результат boolean

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

Set user to connected
public setUserConnected ( ) : void
Результат void

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

Set user status
public setUserStatus ( $status ) : mixed
Результат mixed Provider response

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

Set user to unconnected
public setUserUnconnected ( ) : void
Результат void

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

Get or set a token
public token ( $token, $value = null ) : string
Результат string

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

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

The provider api client (optional)
public stdClass $api
Результат stdClass

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

Model should use "gzip,deflate" for CURLOPT_ENCODING
public stdClass $compressed
Результат stdClass

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

Specific provider adapter config
public array $config
Результат array

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

Endpoint URL for that provider
public string $endpoint
Результат string

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

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

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

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

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

Enable this to replace '.' with '_' characters in the callback urls
public bool $useSafeUrls
Результат boolean

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

Hybrid_User obj, represents the current loggedin user
public Hybrid_User $user
Результат Hybrid_User