Author: Sebastian Bergmann Date: 2007-01-29 10:12:18 +0100 (Mon, 29 Jan 2007) New Revision: 4591
Log: - Add some interface fluidity. Modified: experimental/Workflow/src/interfaces/node.php experimental/Workflow/src/interfaces/node_conditional_branch.php Modified: experimental/Workflow/src/interfaces/node.php =================================================================== --- experimental/Workflow/src/interfaces/node.php 2007-01-28 10:10:46 UTC (rev 4590) +++ experimental/Workflow/src/interfaces/node.php 2007-01-29 09:12:18 UTC (rev 4591) @@ -172,16 +172,16 @@ /** * Adds a node to the incoming nodes of this node. * - * @param ezcWorkflowNode $node The node that is to be added as incoming node. + * @param ezcWorkflowNode $node The node that is to be added as incoming node. * @throws ezcWorkflowInvalidDefinitionException if the operation violates the constraints of the nodes involved. - * @return boolean true when the node was added, false otherwise. + * @return ezcWorkflowNode */ public function addInNode( ezcWorkflowNode $node ) { // Check whether the node is already an incoming node of this node. if ( ezcWorkflowUtil::findObject( $this->inNodes, $node ) !== false ) { - return false; + return $this; } // Check whether adding the other node to the incoming nodes @@ -211,15 +211,15 @@ $this->inNodes[] = $node; $this->numInNodes++; - return true; + return $this; } /** * Removes a node from the incoming nodes of this node. * - * @param ezcWorkflowNode $node The node that is to be removed as incoming node. + * @param ezcWorkflowNode $node The node that is to be removed as incoming node. * @throws ezcWorkflowInvalidDefinitionException if the operation violates the constraints of the nodes involved. - * @return boolean true when the node was removed, false otherwise. + * @return ezcWorkflowNode */ public function removeInNode( ezcWorkflowNode $node ) { @@ -227,7 +227,7 @@ if ( $index === false ) { - return false; + return $this; } if ( $this->minInNodes !== FALSE && $this->numInNodes - 1 < $this->minInNodes ) @@ -251,22 +251,22 @@ unset( $this->inNodes[$index] ); $this->numInNodes--; - return true; + return $this; } /** * Adds a node to the outgoing nodes of this node. * - * @param ezcWorkflowNode $node The node that is to be added as outgoing node. + * @param ezcWorkflowNode $node The node that is to be added as outgoing node. * @throws ezcWorkflowInvalidDefinitionException if the operation violates the constraints of the nodes involved. - * @return boolean true when the node was added, false otherwise. + * @return ezcWorkflowNode */ public function addOutNode( ezcWorkflowNode $node ) { // Check whether the other node is already an outgoing node of this node. if ( ezcWorkflowUtil::findObject( $this->outNodes, $node ) !== false ) { - return false; + return $this; } // Check whether adding the other node to the outgoing nodes @@ -296,15 +296,15 @@ $this->outNodes[] = $node; $this->numOutNodes++; - return true; + return $this; } /** * Removes a node from the outgoing nodes of this node. * - * @param ezcWorkflowNode $node The node that is to be removed as outgoing node. + * @param ezcWorkflowNode $node The node that is to be removed as outgoing node. * @throws ezcWorkflowInvalidDefinitionException if the operation violates the constraints of the nodes involved. - * @return boolean true when the node was removed, false otherwise. + * @return ezcWorkflowNode */ public function removeOutNode( ezcWorkflowNode $node ) { @@ -312,7 +312,7 @@ if ( $index === false ) { - return false; + return $this; } if ( $this->minOutNodes !== FALSE && $this->numOutNodes - 1 < $this->minOutNodes ) @@ -336,7 +336,7 @@ unset( $this->outNodes[$index] ); $this->numOutNodes--; - return true; + return $this; } /** Modified: experimental/Workflow/src/interfaces/node_conditional_branch.php =================================================================== --- experimental/Workflow/src/interfaces/node_conditional_branch.php 2007-01-28 10:10:46 UTC (rev 4590) +++ experimental/Workflow/src/interfaces/node_conditional_branch.php 2007-01-29 09:12:18 UTC (rev 4591) @@ -57,16 +57,16 @@ /** * Adds a conditional outgoing node to this node. * - * @param ezcWorkflowCondition - * @param ezcWorkflowNode + * @param ezcWorkflowCondition + * @param ezcWorkflowNode + * @return ezcWorkflowNode */ public function addConditionalOutNode( ezcWorkflowCondition $condition, ezcWorkflowNode $outNode ) { - if ( $this->addOutNode( $outNode ) ) - { - $index = ezcWorkflowUtil::findObject( $this->outNodes, $outNode ); - $this->configuration[$index] = $condition; - } + $this->addOutNode( $outNode ); + $this->configuration[ezcWorkflowUtil::findObject( $this->outNodes, $outNode )] = $condition; + + return $this; } /** -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components