TriggerRules Class Reference

Inheritance diagram for TriggerRules:
CheckBoxTriggerRules ContactStateTriggerRules DateTriggerRules DropDownTriggerRules MultiSelectDropDownTriggerRules NumberTriggerRules TextTriggerRules UserTriggerRules

Public Member Functions

 evaluateBeforeSave (RedBeanModel $model, $attribute)
 __construct (TriggerForWorkflowForm $trigger)
 evaluateTimeTriggerBeforeSave (RedBeanModel $model, $attribute, $changeRequiredToProcess=true)

Protected Member Functions

 sanitize ($value)

Protected Attributes

 $trigger

Detailed Description

Class to help the workflow engine understand how to evaluate various triggers

Definition at line 40 of file TriggerRules.php.


Constructor & Destructor Documentation

__construct ( TriggerForWorkflowForm trigger  ) 
Parameters:
TriggerForWorkflowForm $trigger

Definition at line 52 of file TriggerRules.php.


Member Function Documentation

evaluateTimeTriggerBeforeSave ( RedBeanModel model,
attribute,
changeRequiredToProcess = true 
)

For a time trigger, the value must first 'change'. If the operator is TYPE_DOES_NOT_CHANGE, then we can assume true since any 'change' pushes out the time expiration. If the value does 'change', then the operator can be evaluated normally.

Parameters:
RedBeanModel $model
$attribute 
$changeRequiredToProcess - if a change in value is required to confirm the time trigger is true
Returns:
bool

Reimplemented in ConstantBasedStaticDropDownTriggerRules, CurrencyValueTriggerRules, DateTimeTriggerRules, DateTriggerRules, DropDownTriggerRules, and MultiSelectDropDownTriggerRules.

Definition at line 66 of file TriggerRules.php.

sanitize ( value  )  [protected]

Override as needed to add specific sanitization routines. Text for example, has to use strtolower

Parameters:
$value 
Returns:
mixed

Reimplemented in CheckBoxTriggerRules, CurrencyValueTriggerRules, DecimalTriggerRules, IntegerTriggerRules, and TextTriggerRules.

Definition at line 86 of file TriggerRules.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Thu Nov 23 07:10:31 2017