SetState
extends Endpoint
in package
Table of Contents
Constants
- PATH = "/v2/presence/sub-key/%s/channel/%s/uuid/%s/data"
- RESPONSE_IS_JSON = true
Properties
- $cachedTransports : array<string|int, mixed>
- $channels : array<string|int, string>
- $customHost : mixed
- $envelope : PNEnvelope
- $followRedirects : mixed
- $groups : array<string|int, string>
- $pubnub : PubNub
- $state : array<string|int, mixed>
Methods
- __construct() : mixed
- buildParams() : array<string|int, mixed>
- Params build flow: signed <- custom <- default
- buildPath() : string
- channelGroups() : $this
- channels() : $this
- clear() : mixed
- Clear cached envelope
- createResponse() : PNSetStateResult|array<string|int, mixed>
- envelope() : PNEnvelope
- Returns an Envelope that contains both result and status.
- getAffectedChannelGroups() : array<string|int, string>|string
- getAffectedChannels() : array<string|int, string>|string
- getConnectTimeout() : int
- getRequestTimeout() : int
- state() : $this
- sync() : PNSetStateResult
- Return a Result only.
- buildData() : null
- customHeaders() : mixed
- customParams() : array<string|int, mixed>
- defaultHeaders() : mixed
- defaultParams() : array<string|int, mixed>
- fetchPayload() : array<string|int, mixed>
- getAffectedUsers() : mixed
- getName() : string
- getOperationType() : int
- getTransport() : mixed
- httpMethod() : string
- invokeRequest() : PNEnvelope
- invokeRequestAndCacheIt() : PNEnvelope
- isAuthRequired() : bool
- requestOptions() : array<string|int, mixed>
- validateChannelGroups() : mixed
- validateParams() : mixed
- validatePublishKey() : mixed
- validateSecretKey() : mixed
- validateSubscribeKey() : mixed
- createStatus() : PNStatus
- getDefaultTransport() : Transport
Constants
PATH
public
mixed
PATH
= "/v2/presence/sub-key/%s/channel/%s/uuid/%s/data"
RESPONSE_IS_JSON
protected
mixed
RESPONSE_IS_JSON
= true
Properties
$cachedTransports
protected
static array<string|int, mixed>
$cachedTransports
= []
$channels
protected
array<string|int, string>
$channels
= []
$customHost
protected
mixed
$customHost
= null
$envelope
protected
PNEnvelope
$envelope
$followRedirects
protected
mixed
$followRedirects
= true
$groups
protected
array<string|int, string>
$groups
= []
$pubnub
protected
PubNub
$pubnub
$state
protected
array<string|int, mixed>
$state
= []
Methods
__construct()
public
__construct(PubNub $pubnubInstance) : mixed
Parameters
- $pubnubInstance : PubNub
buildParams()
Params build flow: signed <- custom <- default
public
buildParams() : array<string|int, mixed>
Return values
array<string|int, mixed>buildPath()
public
buildPath() : string
Return values
stringchannelGroups()
public
channelGroups(mixed $groups) : $this
Parameters
- $groups : mixed
Return values
$thischannels()
public
channels(string|array<string|int, string> $channels) : $this
Parameters
- $channels : string|array<string|int, string>
Return values
$thisclear()
Clear cached envelope
public
clear() : mixed
createResponse()
public
createResponse(array<string|int, mixed> $result) : PNSetStateResult|array<string|int, mixed>
Parameters
- $result : array<string|int, mixed>
-
Decoded json
Return values
PNSetStateResult|array<string|int, mixed>envelope()
Returns an Envelope that contains both result and status.
public
envelope() : PNEnvelope
All Errors are wrapped, so no need to use try/catch blocks
Return values
PNEnvelopegetAffectedChannelGroups()
public
getAffectedChannelGroups() : array<string|int, string>|string
Return values
array<string|int, string>|stringgetAffectedChannels()
public
getAffectedChannels() : array<string|int, string>|string
Return values
array<string|int, string>|stringgetConnectTimeout()
public
getConnectTimeout() : int
Return values
intgetRequestTimeout()
public
getRequestTimeout() : int
Return values
intstate()
public
state(array<string|int, mixed> $state) : $this
Parameters
- $state : array<string|int, mixed>
Return values
$thissync()
Return a Result only.
public
sync() : PNSetStateResult
Return values
PNSetStateResultbuildData()
protected
buildData() : null
Return values
nullcustomHeaders()
protected
customHeaders() : mixed
customParams()
protected
customParams() : array<string|int, mixed>
Return values
array<string|int, mixed>defaultHeaders()
protected
defaultHeaders() : mixed
defaultParams()
protected
defaultParams() : array<string|int, mixed>
Return values
array<string|int, mixed>fetchPayload()
protected
static fetchPayload(mixed $json) : array<string|int, mixed>
Parameters
- $json : mixed
Tags
Return values
array<string|int, mixed>getAffectedUsers()
protected
getAffectedUsers() : mixed
getName()
protected
getName() : string
Return values
stringgetOperationType()
protected
getOperationType() : int
Return values
intgetTransport()
protected
getTransport() : mixed
httpMethod()
protected
httpMethod() : string
Return values
string —PNHttpMethod
invokeRequest()
protected
invokeRequest() : PNEnvelope
Return values
PNEnvelopeinvokeRequestAndCacheIt()
protected
invokeRequestAndCacheIt() : PNEnvelope
Tags
Return values
PNEnvelopeisAuthRequired()
protected
isAuthRequired() : bool
Return values
boolrequestOptions()
protected
requestOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>validateChannelGroups()
protected
validateChannelGroups(array<string|int, string>|string $channels, array<string|int, string>|string $groups) : mixed
Parameters
- $channels : array<string|int, string>|string
- $groups : array<string|int, string>|string
Tags
validateParams()
protected
validateParams() : mixed
Tags
validatePublishKey()
protected
validatePublishKey() : mixed
Tags
validateSecretKey()
protected
validateSecretKey() : mixed
Tags
validateSubscribeKey()
protected
validateSubscribeKey() : mixed
Tags
createStatus()
private
createStatus(int $category, mixed $response, ResponseInfo|null $responseInfo, PubNubException|null $exception) : PNStatus
Parameters
- $category : int
- $response : mixed
- $responseInfo : ResponseInfo|null
- $exception : PubNubException|null
Return values
PNStatusgetDefaultTransport()
private
getDefaultTransport() : Transport