Contentserv PHP API

CSMessage
in package

Tags

Table of Contents

addArgument()  : void
Adds an argument to the message's argument list. This only works if message has not been queued yet.
create()  : CSMessage
Creates a new message instance based on the provided arguments.
dequeue()  : bool
Dequeues an already queued message. This only works if the message has not been picked up for processing yet.
getStatusLabels()  : array<string|int, mixed>
Returns labels for the STATUS-constants
getTypeLabels()  : array<string|int, mixed>
Returns labels for the TYPE-constants
process()  : bool
Sets the status of a message to "ready" to assure it gets picked up by the queue process.
queue()  : bool
Queues a message and makes it available for further processing by the message queue.
setArguments()  : void
Sets the arguments for the current message. This only works if message has not been queued yet.

Methods

addArgument()

Adds an argument to the message's argument list. This only works if message has not been queued yet.

public addArgument(string $sName, mixed $mValue) : void
Parameters
$sName : string

The name of the argument to add

$mValue : mixed

The value to be added.

Tags
access

public

Return values
void

create()

Creates a new message instance based on the provided arguments.

public static create(string $sName, int $iType, object $oTarget) : CSMessage
Parameters
$sName : string

The name of the message.

$iType : int

The type of the message as one of the CSMessageConst::TYPE_* constants

$oTarget : object

The target object matching the type parameter

Tags
access

public

Return values
CSMessage

The newly created message.

dequeue()

Dequeues an already queued message. This only works if the message has not been picked up for processing yet.

public dequeue() : bool
Tags
access

public

Return values
bool

True if message has been dequeued successfully, otherwise false.

getStatusLabels()

Returns labels for the STATUS-constants

public static getStatusLabels() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

The labels for the STATUS-constants.

getTypeLabels()

Returns labels for the TYPE-constants

public static getTypeLabels() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

The labels for the TYPE-constants.

process()

Sets the status of a message to "ready" to assure it gets picked up by the queue process.

public process() : bool

This only works if the message is in "created" state.

Tags
access

public

Return values
bool

True, if message has been set to "ready", otherwise false.

queue()

Queues a message and makes it available for further processing by the message queue.

public queue() : bool

IMPORTANT: the message is set to status "created" and will be moved to "ready" after the script execution finishes. If the message should be processed immediately, please use "CSMessage::process"-method.

Tags
access

public

Return values
bool

True if message has been queued successfully, otherwise false.

setArguments()

Sets the arguments for the current message. This only works if message has not been queued yet.

public setArguments(array<string|int, mixed> $aArguments) : void
Parameters
$aArguments : array<string|int, mixed>

The arguments as key/value pairs.

Tags
access

public

Return values
void

        

Search results