core/model/modx/registry/modregister.class.php

Show: inherited
Table of Contents

Represents a container used for producing and consuming messages.

Abstract
Implement a derivative of this class to provide the behavior for the abstract methods, or override other public or protected methods at your discretion.  
Package
modx  
Subpackage
registry  

\modRegister

Package: modx\registry

Represents a container used for producing and consuming messages.

Children
\modFileRegister
\modDbRegister
Abstract
Implement a derivative of this class to provide the behavior for the abstract methods, or override other public or protected methods at your discretion.  

Properties

Propertypublicboolean  $__kill= 'false'

A polling flag that will terminate additional polling when true.

Default valuefalseDetails
Type
boolean
Propertyprotectedstring  $_currentTopic= ''/''

An optional current topic to allow writes to relative paths.

Default value'/'Details
Type
string
Access
protected  
Propertyprotectedstring  $_key= 'null'

The key identifying this register in a registry.

Default valuenullDetails
Type
string
Access
protected  
Propertypublic\modX  $modx= 'null'

A reference to the modX instance the register is loaded by.

Default valuenullDetails
Type
\modX
Access
public  
Propertypublicarray  $options= 'null'

An array of global options applied to the registry.

Default valuenullDetails
Type
array
Access
public  
Propertypublicarray  $subscriptions= 'array()'

An array of topics and/or messages the register is subscribed to.

Default valuearray()Details
Type
array
Access
public  

Methods

methodpublic__construct( \modX $modx, string $key, array $options = array() ) : void

Construct a new modRegister.

Parameters
Name Type Description
$modx \modX

&$modx A reference to a modX instance.

$key string

A valid PHP variable which will be set on the modRegistry instance.

$options array

Optional array of registry options.

methodpublicabort(  $transactionKey ) : void

Parameters
Name Type Description
$transactionKey
methodpublicacknowledge( string $messageKey, string $transactionKey ) : void

Acknowledge the registry was read

Parameters
Name Type Description
$messageKey string

The key of the message being read

$transactionKey string

The secure key of the transaction that is reading

methodpublicbegin( \$transactionKey $transactionKey ) : void

Begin the reading of the message

Parameters
Name Type Description
$transactionKey \$transactionKey

The key of the message

methodpublicclose( ) : boolean
abstract

Close the connection to the register service implementation.

Returns
Type Description
boolean Indicates if the connection was closed successfully.
Details
Abstract
Implement this only if necessary for the implementation.  
methodpubliccommit( string $transactionKey ) : void

Commit the transaction and finish

Parameters
Name Type Description
$transactionKey string

The key of the transaction

methodpublicconnect( array $attributes = array() ) : boolean
abstract

Connect to the register service implementation.

Parameters
Name Type Description
$attributes array

A collection of attributes required for connection to the register.

Returns
Type Description
boolean Indicates if the connection was successful.
Details
Abstract
Implement this only if necessary for the implementation.  
methodpublicgetCurrentTopic( ) : string

Get the current topic of the register.

Returns
Type Description
string The current topic set for the register.
methodpublicgetKey( ) : string

Get the key of this registry

Returns
Type Description
string The key of the current registry
methodpublicread( array $options = array() ) : mixed
abstract

Reads any undigested messages from subscribed topics.

Parameters
Name Type Description
$options array

An array of general or protocol specific options.

Returns
Type Description
mixed The resulting message from the register.
methodpublicsend( string $topic, mixed $message, array $options = array() ) : boolean
abstract

Send a message to the register.

Parameters
Name Type Description
$topic string

A topic container in which to broadcast the message.

$message mixed

A message, or collection of messages to be sent to the register.

$options array

An optional array of general or protocol specific message properties.

Returns
Type Description
boolean Indicates if the message was recorded.
Details
Abstract
Implement this function in derivatives to send a message to a specific register (e.g. modFileRegister for file-based registers, modStompRegister for ActiveMQ, etc.).  
methodpublicsetCurrentTopic( string $topic ) : void

Set the current topic to be read

Parameters
Name Type Description
$topic string

The key of the topic

methodpublicsubscribe( string $topic ) : boolean

Subscribe to a topic (or specific message) in the register.

Parameters
Name Type Description
$topic string

The path representing the topic or message.

Returns
Type Description
boolean Indicates if the subscription was successful.
methodpublicunsubscribe( string $topic ) : boolean

Unsubscribe from a topic (or specific message) in the register.

Parameters
Name Type Description
$topic string

The path representing the topic or message.

Returns
Type Description
boolean Indicates if the subscription was removed successfully.
Documentation was generated by DocBlox 0.18.1.