phpDocumentor

HubSessionsApiClient
in package
implements HubSessionsApiClientInterface

Class HubSessionApiClient

Tags
category

System

subpackage

GambioHub

Interfaces, Classes and Traits

HubSessionsApiClientInterface
Interface HubSessionApiClientInterface

Table of Contents

$clientKeyConfiguration  : HubClientKeyConfiguration
$curlRequest  : CurlRequest
$hubSessionKeyService  : HubSessionKeyService
$hubSettings  : HubSettings
$logControl  : LogControl
$secondsBetweenNotifications  : int
$url  : string
__construct()  : mixed
HubSessionApiClient constructor.
startSession()  : string
Starts a session in the Gambio Hub.
_sendUrlChangedNotification()  : $this|HubSessionsApiClient
Sends a request to the hub that the shop url could be changed.
determineConnectorVersion()  : string
Checks the version_info folder for the latest connector version and returns it

Properties

Methods

__construct()

HubSessionApiClient constructor.

public __construct(string $url, HubSessionKeyService $hubSessionKeyService, HubClientKeyConfiguration $hubClientKeyConfiguration, CurlRequest $curlRequest, LogControl $logControl, HubSettings $hubSettings) : mixed
Parameters
$url : string

Gambio Hub API URL

$hubSessionKeyService : HubSessionKeyService

Used for retrieving the session key.

$hubClientKeyConfiguration : HubClientKeyConfiguration

Stores or retrieves the hub client key from shop configuration.

$curlRequest : CurlRequest

Make cURL requests to the Hub API.

$logControl : LogControl

Log communication error information.

$hubSettings : HubSettings

Hub settings.

Tags
throws
InvalidArgumentException

If the $url argument is not a valid URL.

Return values
mixed

startSession()

Starts a session in the Gambio Hub.

public startSession(AuthHash $authHash, string $shopUrl, LanguageCode $languageCode) : string

Provide an authorization hash that can be later used in the hub callbacks to determine where each session key belongs to. This method will additionally save the AuthHash value to the PHP session with the key 'gambio_hub_auth_hash' for later reference.

Parameters
$authHash : AuthHash

The authorization hash to be used for the session start.

$shopUrl : string

Shop url with trailing slash.

$languageCode : LanguageCode
Tags
throws
UnexpectedValueException

If the server responses with status code different to 201.

Return values
string

Returns the new session key.

_sendUrlChangedNotification()

Sends a request to the hub that the shop url could be changed.

protected _sendUrlChangedNotification(string $clientKey) : $this|HubSessionsApiClient
Parameters
$clientKey : string

Client key of the shop.

Tags
throws
UnexpectedValueException

Every time when the method is called.

Return values
$this|HubSessionsApiClient

Same instance for chained method calls.

determineConnectorVersion()

Checks the version_info folder for the latest connector version and returns it

private determineConnectorVersion() : string
Return values
string

Search results