public function run($name, AnCommandContext $context)
    {
        if ($this->_enabled) {
            $this->getStack()->push(clone $this);

            foreach ($this->getStack()->top() as $command) {
                if ($command->execute($name, $context) === $this->_break_condition) {
                    $this->getStack()->pop();
                    return $this->_break_condition;
                }
            }

            $this->getStack()->pop();
        }
    }
public function run($name, AnCommandContext $context)
    {
        if ($this->_enabled) {
            $this->getStack()->push(clone $this);

            foreach ($this->getStack()->top() as $command) {
                if ($command->execute($name, $context) === $this->_break_condition) {
                    $this->getStack()->pop();
                    return $this->_break_condition;
                }
            }

            $this->getStack()->pop();
        }
    }
public function run ( $ name , AnCommandContext $ context ) { if ( $ this -> _enabled ) { $ this -> getStack ( ) -> push ( clone $ this ) ; foreach ( $ this -> getStack ( ) -> top ( ) as $ command ) { if ( $ command -> execute ( $ name , $ context ) === $ this -> _break_condition ) { $ this -> getStack ( ) -> pop ( ) ; return $ this -> _break_condition ; } } $ this -> getStack ( ) -> pop ( ) ; } }
Run the commands in the chain

If a command returns the 'break condition' the executing is halted.

@param string $name
@param AnCommandContext $context
@return void|boolean If the chain breaks, returns the break condition. Default returns void.
Run the commands in the chain