CREvent

This class represents events sent between controller and responder clients

Contstructor

__construct($config)
Parameters
$config
CRConfig object, required
Configuration parameters and methods

Properties

$eventType
String, default = ""
Event type
$eventSubType
String, default = ""
Optional subtype, providing explanatory information not affecting event handling
$eventParams
Array, default = []
An array of strings
The strings must not contain the $eventDataSplitChar ("," by default)
$buffered
Boolean, default = false
If true, the event will be saved if the client is offline and sent (if possible) when it becomes online
$logged
Boolean, default = false
If true the event will always be logged by the eventSender, even if not sent
$interceptable
Boolean, default = true
If true, the event can be rejected or modified by functions at eventSender and eventReceiver
$sendCt
Number, default = NaN
Calendar time in millisecs indicating when the event was sent by the sender client
$receiveCt
Number, default = NaN
Calendar time in millisecs indicating when the event was received by the recipient client
$senderClientId
String, default = ""
Id of the sender client
$senderClientRole
String, default = ""
Role of the sender client, not transmitted to the recipient client
$senderAccessToken
String, default = ""
Access token sender client, not transmitted to the recipient client
$recipientClientId
String, default = ""
Id of the client app to which the event is sent

Methods

getReadyToSend() → Boolean
Returns true if the event contains the required properties and credentials to be sent
updateContent($eventType, $eventSubType = "", $eventParams = [])
Updates the event with content properties transmitted to the receiver client app
Parameters
$eventType
String, required
Event type
$eventSubType
String, default = ""
Optional subtype, providing information that does not affect event handling
eventParams
Array, default = []
An array of strings
The strings must not contain the $eventDataSplitChar ("," by default)
updateAuthInfo(senderClientId, senderClientRole, senderAccessToken)
Updates the event with properties required for authentication
Parameters
$senderClientId
String, required
Identifies a client app
$senderClientRole
String, required
Role of the sender client, not transmitted to the recipient client
$senderAccessToken
String, required
Access token of the sender client, not transmitted to the recipient client
initWithOtherCrEvent(%otherEvent)
Initiates the event with eventType, eventSubType and eventParams from another CREvent
Parameters
$otherEvent
CREvent, required
send()
Sends the event if it contains the required properties and credentials to be sent