Documentation

Subscribe extends Endpoint
in package

Table of Contents

Constants

PATH  = "/v2/subscribe/%s/%s/0"
RESPONSE_IS_JSON  = true

Properties

$cachedTransports  : array<string|int, mixed>
$channelGroups  : array<string|int, string>
$channels  : array<string|int, string>
$customHost  : mixed
$envelope  : PNEnvelope
$filterExpression  : string
$followRedirects  : mixed
$pubnub  : PubNub
$region  : string
$timetoken  : int
$withPresence  : bool

Methods

__construct()  : mixed
channelGroups()  : $this
channels()  : $this
clear()  : mixed
Clear cached envelope
envelope()  : PNEnvelope
Returns an Envelope that contains both result and status.
setFilterExpression()  : $this
setRegion()  : $this
setTimetoken()  : $this
setWithPresence()  : $this
sync()  : SubscribeEnvelope
Return a Result only.
buildData()  : null
buildParams()  : array<string|int, mixed>
Params build flow: signed <- custom <- default
buildPath()  : string
createResponse()  : SubscribeEnvelope
customHeaders()  : mixed
customParams()  : array<string|int, mixed>
defaultHeaders()  : mixed
defaultParams()  : array<string|int, mixed>
fetchPayload()  : array<string|int, mixed>
getAffectedChannelGroups()  : mixed
getAffectedChannels()  : mixed
getAffectedUsers()  : mixed
getConnectTimeout()  : int
getName()  : string
getOperationType()  : int
getRequestTimeout()  : 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/subscribe/%s/%s/0"

RESPONSE_IS_JSON

protected mixed RESPONSE_IS_JSON = true

Properties

$cachedTransports

protected static array<string|int, mixed> $cachedTransports = []

$channelGroups

protected array<string|int, string> $channelGroups = []

$channels

protected array<string|int, string> $channels = []

$customHost

protected mixed $customHost = null

$filterExpression

protected string $filterExpression

$followRedirects

protected mixed $followRedirects = true

Methods

__construct()

public __construct(PubNub $pubnubInstance) : mixed
Parameters
$pubnubInstance : PubNub

channelGroups()

public channelGroups(string|array<string|int, string> $cgs) : $this
Parameters
$cgs : string|array<string|int, string>
Return values
$this

channels()

public channels(string|array<string|int, string> $ch) : $this
Parameters
$ch : string|array<string|int, string>
Return values
$this

clear()

Clear cached envelope

public clear() : 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
PNEnvelope

setFilterExpression()

public setFilterExpression(string $filterExpression) : $this
Parameters
$filterExpression : string
Return values
$this

setRegion()

public setRegion(string $region) : $this
Parameters
$region : string
Return values
$this

setTimetoken()

public setTimetoken(int $timetoken) : $this
Parameters
$timetoken : int
Return values
$this

setWithPresence()

public setWithPresence(bool $withPresence) : $this
Parameters
$withPresence : bool
Return values
$this

buildData()

protected buildData() : null
Return values
null

buildParams()

Params build flow: signed <- custom <- default

protected buildParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

buildPath()

protected buildPath() : string
Return values
string

customHeaders()

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
throws
PubNubResponseParsingException
Return values
array<string|int, mixed>

getAffectedChannelGroups()

protected getAffectedChannelGroups() : mixed

getAffectedChannels()

protected getAffectedChannels() : mixed

getAffectedUsers()

protected getAffectedUsers() : mixed

getConnectTimeout()

protected getConnectTimeout() : int
Return values
int

getName()

protected getName() : string
Return values
string

getOperationType()

protected getOperationType() : int
Return values
int

getRequestTimeout()

protected getRequestTimeout() : int
Return values
int

getTransport()

protected getTransport() : mixed

httpMethod()

protected httpMethod() : string
Return values
string

isAuthRequired()

protected isAuthRequired() : bool
Return values
bool

requestOptions()

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
throws
PubNubValidationException

        
On this page

Search results