Contentserv PHP API

CSStagingQueue
in package

Tags

Table of Contents

countMessages()  : int
Counts the number of messages in the staging queue based on the given filter.
deleteMessage()  : bool
Deletes a message from the staging queue.
deleteMessages()  : int
Deletes messages from the staging queue based on a filter.
enqueue()  : void
Enqueues a record in the staging queue as a StagingMessage database entry.
fetch()  : array<string|int, mixed>
Fetches entries from the staging queue as their API object. A fetch always queues the messages.
getMessage()  : CSStagingMessage
Retrieves the Stagingmessage API object.
getMessages()  : array<string|int, mixed>
Retrieves messages based on a given filter
getSortFilter()  : string
Returns the sort filter used by the staging queue.
hasMessagesForProcessing()  : bool
Checks if there are any messages for processing in the staging queue.
purge()  : bool
Purges the staging queue.
queryMessages()  : array<string|int, mixed>
Queries the messages from the staging queue.
reset()  : bool
Resets all messages in the staging queue so they are dequeued.
storeMessage()  : bool
Stores a CSStagingMessage API object in the database.

Methods

countMessages()

Counts the number of messages in the staging queue based on the given filter.

public static countMessages([CSStagingQueueFilter $oFilter = null ]) : int
Parameters
$oFilter : CSStagingQueueFilter = null
Tags
Return values
int

The number of messages that match the filter.

deleteMessage()

Deletes a message from the staging queue.

public static deleteMessage(int $iMessageId) : bool
Parameters
$iMessageId : int

The ID of the message to be deleted.

Tags
Return values
bool

Returns true if the message was successfully deleted, false otherwise.

enqueue()

Enqueues a record in the staging queue as a StagingMessage database entry.

public static enqueue([array<string|int, mixed> $aArguments = array() ]) : void

For persistent queues the RecordID and RecordType are required. For example: ['RecordID' => 1, 'RecordType' => 'Pdmarticle']

Parameters
$aArguments : array<string|int, mixed> = array()

The arguments for the job.

Tags
Return values
void

fetch()

Fetches entries from the staging queue as their API object. A fetch always queues the messages.

public static fetch(int $iBatchSize[, CSStagingQueueFilter $oAdditionalFilter = null ]) : array<string|int, mixed>

Make sure to dequeue/acknowledge/reject the messages after processing them.

Note: To only analyse messages without fetching them use the getMessages API.

Parameters
$iBatchSize : int

The number of items to fetch.

$oAdditionalFilter : CSStagingQueueFilter = null
Tags
Return values
array<string|int, mixed>

An array of fetched item APIs.

getMessages()

Retrieves messages based on a given filter

public static getMessages([CSStagingQueueFilter $oFilter = null ]) : array<string|int, mixed>
Parameters
$oFilter : CSStagingQueueFilter = null
Tags
Return values
array<string|int, mixed>

An array containing the retrieved messages.

getSortFilter()

Returns the sort filter used by the staging queue.

public abstract static getSortFilter() : string

Blueprint method and has to be overwritten by the specific queue. Defines in which order the messages are fetched.

Tags
Return values
string

The sort filter.

hasMessagesForProcessing()

Checks if there are any messages for processing in the staging queue.

public static hasMessagesForProcessing() : bool
Tags
Return values
bool

Returns true if there are messages for processing, false otherwise.

purge()

Purges the staging queue.

public static purge() : bool
Tags
Return values
bool

Returns true if the purge operation is successful, false otherwise.

queryMessages()

Queries the messages from the staging queue.

public static queryMessages(array<string|int, mixed> $aFields, CSStagingQueueFilter $oFilter, int $iLimit) : array<string|int, mixed>
Parameters
$aFields : array<string|int, mixed>

The fields to retrieve for each message.

$oFilter : CSStagingQueueFilter

The filter to apply to the query.

$iLimit : int

The maximum number of messages to retrieve (default: 0 for no limit).

Tags
Return values
array<string|int, mixed>

The array of messages matching the query.

reset()

Resets all messages in the staging queue so they are dequeued.

public static reset() : bool

Primarily used for failover scenarios.

Tags
Return values
bool

Returns true if the staging queue is successfully reset, false otherwise.

storeMessage()

Stores a CSStagingMessage API object in the database.

public static storeMessage(CSStagingMessage $oMessageApi) : bool
Parameters
$oMessageApi : CSStagingMessage

The CSStagingMessage object to be stored.

Tags
Return values
bool

Returns true if the message is successfully stored, false otherwise.


        

Search results