public function stateChanged($entity, $current, $new)
    {
        $key = $current.'=>'.$new;

        if (!isset($this->_machine[$key])) {
            return true;
        }

        $callbacks = $this->_machine[$key];

        foreach ($callbacks as $callback) {
            $result = $callback;
            if (is_string($callback)) {
                $result = $this->{'_'.$callback}($entity);
            }
            if ($result === false) {
                return false;
            }
        }

        return true;
    }
public function stateChanged($entity, $current, $new)
    {
        $key = $current.'=>'.$new;

        if (!isset($this->_machine[$key])) {
            return true;
        }

        $callbacks = $this->_machine[$key];

        foreach ($callbacks as $callback) {
            $result = $callback;
            if (is_string($callback)) {
                $result = $this->{'_'.$callback}($entity);
            }
            if ($result === false) {
                return false;
            }
        }

        return true;
    }
public function stateChanged ( $ entity , $ current , $ new ) { $ key = $ current . '=>' . $ new ; if ( ! isset ( $ this -> _machine [ $ key ] ) ) { return true ; } $ callbacks = $ this -> _machine [ $ key ] ; foreach ( $ callbacks as $ callback ) { $ result = $ callback ; if ( is_string ( $ callback ) ) { $ result = $ this -> { '_' . $ callback } ( $ entity ) ; } if ( $ result === false ) { return false ; } } return true ; }
Run a state change into the state machine.

@param AnDomainEntityAbstract $entity
@param int                    $current
@param int                    $new
Run a state change into the state machine .