public function setStartState($stateId)
    {
        $state = $this->stateMachine->getState(StateMachine::STATE_INITIAL);
        if ($state === null) {
            $state = new InitialState(StateMachine::STATE_INITIAL);
            $this->stateMachine->addState($state);
        }

        $this->addTransition(StateMachine::STATE_INITIAL, $stateId, StateMachine::EVENT_START);
    }
public function setStartState($stateId)
    {
        $state = $this->stateMachine->getState(StateMachine::STATE_INITIAL);
        if ($state === null) {
            $state = new InitialState(StateMachine::STATE_INITIAL);
            $this->stateMachine->addState($state);
        }

        $this->addTransition(StateMachine::STATE_INITIAL, $stateId, StateMachine::EVENT_START);
    }
public function setStartState ( $ stateId ) { $ state = $ this -> stateMachine -> getState ( StateMachine :: STATE_INITIAL ) ; if ( $ state === null ) { $ state = new InitialState ( StateMachine :: STATE_INITIAL ) ; $ this -> stateMachine -> addState ( $ state ) ; } $ this -> addTransition ( StateMachine :: STATE_INITIAL , $ stateId , StateMachine :: EVENT_START ) ; }
Sets the given state as the start state of the state machine.

@param string $stateId
Sets the given state as the start state of the state machine .