Perforce Chronicle 2012.2/486814
API Documentation
|
Provide a common interface for workflow conditions. More...
Public Member Functions | |
evaluate (Workflow_Model_Transition $transition, P4Cms_Record $record, array $pending=null) | |
Evaluate if this condition is satisfied for given transition and record. | |
getOptions () | |
Get options attached to the condition. | |
setOptions (array $options) | |
Set options for this condition. |
Provide a common interface for workflow conditions.
Workflow conditions control which workflow transitions are valid for a given record.
Workflow_ConditionInterface::evaluate | ( | Workflow_Model_Transition $ | transition, |
P4Cms_Record $ | record, | ||
array $ | pending = null |
||
) |
Evaluate if this condition is satisfied for given transition and record.
There is the option of passing an array of pending values to consider when evaluating conditions. These would typically come from a request as the user makes changes to the record.
As the author of a condition class, you are encouraged to check for these pending values to ensure the conditions are evaluated against the most recent data (unless you are specifically concerned with evaulating stored data).
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. |
Implemented in Workflow_ConditionAbstract.
Workflow_ConditionInterface::getOptions | ( | ) |
Get options attached to the condition.
Workflow_ConditionInterface::setOptions | ( | array $ | options | ) |
Set options for this condition.
array | $options | condition options to set. |