class AccountContext

The context of an request for an account.

Methods

__construct(IRI $aauid, $accessToken, DataLoader $dataLoader = null)

Create a new context using an AAUID and an OAuth 2.0 bearer access token.

static 
fromSymfonyRequest(Request $request)

Create a new context from the current request.

static 
fromPsrRequest(RequestInterface $request)

Create a new context from the current request.

getAAUID()

No description

getAccessToken()

No description

getRequest()

No description

getDataLoader()

No description

getAccount()

No description

getPerson()

No description

usesAccountConnection()

Checks whether the context uses an account connection, which is the case when an API is requested by a connected account on another service.

getConnectionQualifier()

Get the qualifier of the account connection used for accessing the API.

getInstallQualifier()

Get the qualifier for the connection to the platform service.

getAccessorCOID()

Get the accessor.

string|null
getAccountDomain()

Get the account's domain.

getConnectedAccount($qualifier = null)

Get a connected account.

getAccountConnection($qualifier = null)

Get an account connection.

getConnectedAccountForService($service)

Get the connected account for a service.

getAllAccountConnections()

Get all account connections.

getAllConnectedAccounts()

Get all connected accounts.

pushGraphUpdates()

Pushes changes on the Account Graph into the Account Graph.

setAccountGatewayBaseURLTemplate($baseUrl)

Specifies a template for the Account Gateway Base URL. Must be a valid URL that may contain an {aauid} placeholder. Call this if you want to redirect traffic through a proxy or a staging or mock instance of an Account Gateway. Most users of this SDK should never call this function.

Client
getClient()

Get a preconfigured Guzzle client to access the Account Gateway.

setLogCode($logCode)

Set a custom code for the current request in the Account Gateway logs.

processResponse(Response $response)

Process a response and add headers if applicable.

boolean
isNewAccessorVersionAvailable()

Check whether a new version of the accessor is available. This information is updated from incoming and outgoing requests. If no request was executed, returns false.

IRI|null
getLatestAccessorVersionCOID()

Get the COID of the latest accessor version, if one is available, or null otherwise. This information is updated from incoming and outgoing requests. If no request was executed, returns null.

setLatestAccessorVersionCOID(IRI $latestAccessorVersionCOID)

Set the COID of the latest accessor version. This method should only called from request processing codes. Most developers should not use it.

Details

at line 42
__construct(IRI $aauid, $accessToken, DataLoader $dataLoader = null)

Create a new context using an AAUID and an OAuth 2.0 bearer access token.

Parameters

IRI $aauid
$accessToken
DataLoader $dataLoader

at line 105
static fromSymfonyRequest(Request $request)

Create a new context from the current request.

Parameters

Request $request

at line 124
static fromPsrRequest(RequestInterface $request)

Create a new context from the current request.

Parameters

RequestInterface $request

at line 137
getAAUID()

at line 141
getAccessToken()

at line 145
getRequest()

at line 149
getDataLoader()

at line 161
getAccount()

at line 165
getPerson()

at line 173
usesAccountConnection()

Checks whether the context uses an account connection, which is the case when an API is requested by a connected account on another service.

at line 180
getConnectionQualifier()

Get the qualifier of the account connection used for accessing the API.

at line 188
getInstallQualifier()

Get the qualifier for the connection to the platform service.

Only available when the accessor is an application.

at line 195
getAccessorCOID()

Get the accessor.

at line 205
string|null getAccountDomain()

Get the account's domain.

Only set from external API requests, null otherwise.

Return Value

string|null

at line 213
getConnectedAccount($qualifier = null)

Get a connected account.

Parameters

$qualifier The qualifier for the account connection. If not specified, uses the connection qualifier.

at line 223
getAccountConnection($qualifier = null)

Get an account connection.

Parameters

$qualifier The qualifier for the account connection. If not specified, uses the connection qualifier.

at line 233
getConnectedAccountForService($service)

Get the connected account for a service.

Parameters

$service COID of the service

at line 245
getAllAccountConnections()

Get all account connections.

at line 254
getAllConnectedAccounts()

Get all connected accounts.

at line 265
pushGraphUpdates()

Pushes changes on the Account Graph into the Account Graph.

at line 278
setAccountGatewayBaseURLTemplate($baseUrl)

Specifies a template for the Account Gateway Base URL. Must be a valid URL that may contain an {aauid} placeholder. Call this if you want to redirect traffic through a proxy or a staging or mock instance of an Account Gateway. Most users of this SDK should never call this function.

Parameters

$baseUrl

at line 286
Client getClient()

Get a preconfigured Guzzle client to access the Account Gateway.

Return Value

Client

at line 321
setLogCode($logCode)

Set a custom code for the current request in the Account Gateway logs.

Parameters

$logCode

at line 331
processResponse(Response $response)

Process a response and add headers if applicable.

Parameters

Response $response

at line 344
boolean isNewAccessorVersionAvailable()

Check whether a new version of the accessor is available. This information is updated from incoming and outgoing requests. If no request was executed, returns false.

Return Value

boolean

at line 355
IRI|null getLatestAccessorVersionCOID()

Get the COID of the latest accessor version, if one is available, or null otherwise. This information is updated from incoming and outgoing requests. If no request was executed, returns null.

Return Value

IRI|null

at line 365
setLatestAccessorVersionCOID(IRI $latestAccessorVersionCOID)

Set the COID of the latest accessor version. This method should only called from request processing codes. Most developers should not use it.

Parameters

IRI $latestAccessorVersionCOID