* $set = new ezcWorkflowNodeVariableSet ( array ( 'variable name' = > $value ) ); * * * Incoming nodes: 1 * Outgoing nodes: 1 * * @package Workflow * @version 1.0 */ class ezcWorkflowNodeVariableSet extends ezcWorkflowNode { /** * Constructs a new variable set node with the configuration $configuration. * * The configuration is an array of keys and values of the format: * array( 'workflow variable name' => value ) * * @param mixed $configuration * @throws ezcBaseValueException */ public function __construct( $configuration = '' ) { if ( !is_array( $configuration ) ) { throw new ezcBaseValueException( 'configuration', $configuration, 'array' ); } parent::__construct( $configuration ); } /** * Executes this by setting all the variables specified by the * configuration. * * @param ezcWorkflowExecution $execution * @ignore */ public function execute( ezcWorkflowExecution $execution ) { foreach ( $this->configuration as $variable => $value ) { $execution->setVariable( $variable, $value ); } $this->activateNode( $execution, $this->outNodes[0] ); return parent::execute( $execution ); } /** * Returns a textual representation of this node. * * @return string * @ignore */ public function __toString() { $buffer = array(); foreach ( $this->configuration as $variable => $value ) { $buffer[] = $variable . ' = ' . ezcWorkflowUtil::variableToString( $value ); } return implode( ', ', $buffer ); } } ?>