Perforce Chronicle 2012.2/486814
API Documentation

Workflow_ConditionInterface Interface Reference

Provide a common interface for workflow conditions. More...

Inheritance diagram for Workflow_ConditionInterface:
Workflow_ConditionAbstract Workflow_Workflow_Condition_Contains Workflow_Workflow_Condition_False

List of all members.

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.

Detailed Description

Provide a common interface for workflow conditions.

Workflow conditions control which workflow transitions are valid for a given record.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

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).

Parameters:
Workflow_Model_Transition$transitiontransition to evaluate this condition for.
P4Cms_Record$recordrecord to evaluate this condition for.
array | null$pendingoptional - updated values to consider.
Returns:
boolean true if this condition is satisfied for transition and record, false otherwise.

Implemented in Workflow_ConditionAbstract.

Workflow_ConditionInterface::getOptions ( )

Get options attached to the condition.

Returns:
array condition options.
Workflow_ConditionInterface::setOptions ( array $  options)

Set options for this condition.

Parameters:
array$optionscondition options to set.

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