* $unset = new ezcWorkflowNodeVariableUnset ( 'variable name' ) ; * * * Incoming nodes: 1 * Outgoing nodes: 1 * * @package Workflow * @version 1.0 */ class ezcWorkflowNodeVariableUnset extends ezcWorkflowNode { /** * Constructs a new unset node. * * Configuration format: * String: * The name of the workflow variable to unset. * * Array: * An array of names of the workflow variables to unset. * * @param mixed $configuration * @throws ezcBaseValueException */ public function __construct( $configuration = '' ) { if ( is_string( $configuration ) ) { $configuration = array( $configuration ); } if ( !is_array( $configuration ) ) { throw new ezcBaseValueException( 'configuration', $configuration, 'array' ); } parent::__construct( $configuration ); } /** * Executes this node. * * @param ezcWorkflowExecution $execution * @ignore */ public function execute( ezcWorkflowExecution $execution ) { foreach ( $this->configuration as $variable ) { $execution->unsetVariable( $variable ); } $this->activateNode( $execution, $this->outNodes[0] ); return parent::execute( $execution ); } /** * Returns a textual representation of this node. * * @return string * @ignore */ public function __toString() { return 'unset(' . implode( ', ', $this->configuration ) . ')'; } } ?>