UNA
Loading...
Searching...
No Matches
BxDolAlerts Class Reference
Inheritance diagram for BxDolAlerts:
BxDol

Public Member Functions

 __construct ($sUnit, $sAction, $iObjectId, $iSender=false, $aExtras=array())
 
 alert ()
 
 getAlertsData ()
 

Static Public Member Functions

static cacheInvalidate ()
 

Public Attributes

 $sUnit
 
 $sAction
 
 $iObject
 
 $iSender
 
 $aExtras
 

Protected Attributes

 $_aAlerts
 
 $_aHandlers
 
 $_aCacheTriggers
 
 $_aCacheTriggersMarkers
 
 $_oCacheObject
 

Static Protected Attributes

static $_aCacheData
 

Detailed Description

Alert/Handler/Hooks engine.

Is needed to fire some alert(event) in one place and caught it with a handler somewhere else.

Related classes: BxDolAlertsResponse - abstract class for all response classes.

Example of usage:

First Fire an alert

$oZ = new BxDolAlerts('unit_name', 'action', 'object_id', 'sender_id', array('of_extra_params'));
$oZ->alert();
Definition BxDolAlerts.php:39

or

bx_alert('unit_name', 'action', 'object_id', 'sender_id', ['extra', 'params']);
bx_alert($sUnit, $sAction, $iObjectId, $iSender=false, $aExtras=array())
Definition utils.inc.php:1872

Second Add handler and caught alert(s) a. Create Response class by extending BxDolAlertsResponse class. It should process all necessary alerts which are passed to it.
b. Register your handler in the database by adding it in sys_alerts_handlers table.
c. Associate necessary alerts with the handler by adding them in the sys_alerts table.

Constructor & Destructor Documentation

◆ __construct()

BxDolAlerts::__construct ( $sUnit,
$sAction,
$iObjectId,
$iSender = false,
$aExtras = array() )

Constructor

Parameters
string$sType- system type
string$sAction- system action
int$iObjectId- object id
int$iSenderId- sender (action's author) profile id, if it is false - then currectly logged in profile id is used

Member Function Documentation

◆ alert()

BxDolAlerts::alert ( )

Notifies the necessary handlers about the alert.

◆ getAlertsData()

BxDolAlerts::getAlertsData ( )

Cache alerts and handlers.

Returns
an array with all alerts and handlers.

The documentation for this class was generated from the following file: