|
Perforce Chronicle 2012.2/486814
API Documentation
|
Base class for workflow conditions. More...
Public Member Functions | |
| evaluate (Workflow_Model_Transition $transition, P4Cms_Record $record, array $pending=null) | |
| Determine if this condition is satisified for the given transition and record. | |
| isNegated () | |
| Detrmine if condition is negated, i.e. | |
Public Attributes | |
| const | OPTION_NEGATE = 'negate' |
Protected Member Functions | |
| _evaluate (Workflow_Model_Transition $transition, P4Cms_Record $record, array $pending=null) | |
| This is the real workhorse to evaluate if condition is satisfied for the given transition in context with given record. | |
Base class for workflow conditions.
Workflow conditions control which workflow transitions are valid for a given record.
This abstract class provides basic handling of options (curtesy of the plugin abstract class) and the ability to negate a condition (via the 'negate' option). Sub-classes must implement _evaluate().
| Workflow_ConditionAbstract::_evaluate | ( | Workflow_Model_Transition $ | transition, |
| P4Cms_Record $ | record, | ||
| array $ | pending = null |
||
| ) | [abstract, protected] |
This is the real workhorse to evaluate if condition is satisfied for the given transition in context with given record.
Must be implemented by sub-class.
See Workflow_ConditionInterface for further commentary.
| Workflow_Model_Transition | $transition | transition to evaluate this condition for. |
| P4Cms_Record | $record | record to evaluate this condition for. |
| array | null | $pending | optional - updated values to consider. |
Reimplemented in Workflow_Workflow_Condition_Contains, and Workflow_Workflow_Condition_False.
| Workflow_ConditionAbstract::evaluate | ( | Workflow_Model_Transition $ | transition, |
| P4Cms_Record $ | record, | ||
| array $ | pending = null |
||
| ) |
Determine if this condition is satisified for the given transition and record.
Proxies to the _evaluate() method (must be implemented by sub-class) to perform actual work of evaluating the condition. This provides built-in support for a negate option (i.e. returns inverted value if condition is negated).
See Workflow_ConditionInterface for further commentary.
| Workflow_Model_Transition | $transition | transition to evaluate this condition for. |
| P4Cms_Record | $record | record to evaluate this condition for. |
| array | null | $pending | optional - updated values to consider. |
Implements Workflow_ConditionInterface.
| Workflow_ConditionAbstract::isNegated | ( | ) |
Detrmine if condition is negated, i.e.
if 'negate' option is present and set to true.
{
return isset($this->_options[static::OPTION_NEGATE])
&& $this->_options[static::OPTION_NEGATE];
}
| const Workflow_ConditionAbstract::OPTION_NEGATE = 'negate' |