\AdventureRes\Services AbstractAdventureResService

Class AbstractAdventureResService

Summary

Methods
Properties
Constants
__call()
__construct()
setApp()
setHttpClient()
getSessionId()
setSessionId()
No public properties found
API_SERVICE
makeApiCall()
$httpClient
$client
$app
$sessionId
$shouldValidateSessionIds
N/A
No private methods found
No private properties found
N/A

Constants

API_SERVICE

API_SERVICE

The API service used in this class.

Properties

$sessionId

$sessionId : string

Type

string

$shouldValidateSessionIds

$shouldValidateSessionIds : boolean

Type

boolean — This should only be used for testing.

Methods

__call()

__call(  $command,   $arguments) 

Parameters

$command
$arguments

__construct()

__construct(\AdventureRes\AdventureResApp  $app, \AdventureRes\HttpClients\AdventureResHttpClientInterface|null  $client = null, boolean  $shouldValidateSessionIds = true) 

AbstractAdventureResService constructor.

Parameters

\AdventureRes\AdventureResApp $app

The configuration app.

\AdventureRes\HttpClients\AdventureResHttpClientInterface|null $client

Optionally pass in a pre-configured HttpClient.

boolean $shouldValidateSessionIds

This should only be used for testing.

getSessionId()

getSessionId() : string

Gets the session ID to be used in requests. Uses the AdventureResSession class to validate and/or generate a session ID.

Returns

string

setSessionId()

setSessionId(string  $sessionId) 

Sets the session ID.

Parameters

string $sessionId

makeApiCall()

makeApiCall(  $method,   $endpoint,   $params) : \AdventureRes\Http\AdventureResResponse

Generates an AdventureResRequest and sends it via the client.

Parameters

$method
$endpoint
$params

Throws

\AdventureRes\Exceptions\AdventureResResponseException

Returns

\AdventureRes\Http\AdventureResResponse