Nodes

Last updated: April 25th, 2020
Release:

Nodes in the Chain system exist to process data (dispatches). They are connected to each other to form chains using the ChainHelper class, and receive a DispatchBase when they are asked to execute their process() method by the ChainHelper.

DispatchBase

All nodes used with the provided ChainHelper must implement the NodeBase abstract class. This provides meta information for the node and reqiures developers to implement a process() method. The following properties and methods are available on the NodeBase abstract:

Properties

protected string $_key String identifier for node, must be set for node to be usable protected string $_version String version for node, must be set for node to be usable

Methods

public string __toString() Converts the class into a readable string public string getKey() Returns the node key value public string getVersion() Returns the node version value public boolean isValid() Returns whether or not the node is considered valid for processing (both key and version set, at minimum) abstract public void process(mixed $sender, DispatchBase &$dispatch) Abstract method for processing dispatch; Only called if node is valid protected NodeBase setKey(string $key) Sets the node's key value protected NodeBase setVersion(string $version) Sets the node's version value

Examples

For examples, see the 'Node' section of the Examples page.

Further Reading

Next Up

Continue to read about ChainHelper, or visit the Table of Contents.