src/SM/StateMachine/StateMachine.php
protected function setState($state)
    {
        if (!in_array($state, $this->config['states'])) {
            throw new SMException(sprintf(
                'Cannot set the state to "%s" to object "%s" with graph %s because it is not pre-defined.',
                $state,
                get_class($this->object),
                $this->config['graph']
            ));
        }

        $accessor = new PropertyAccessor();
        $accessor->setValue($this->object, $this->config['property_path'], $state);
    }
protected function setState($state)
    {
        if (!in_array($state, $this->config['states'])) {
            throw new SMException(sprintf(
                'Cannot set the state to "%s" to object "%s" with graph %s because it is not pre-defined.',
                $state,
                get_class($this->object),
                $this->config['graph']
            ));
        }

        $accessor = new PropertyAccessor();
        $accessor->setValue($this->object, $this->config['property_path'], $state);
    }
protected function setState ( $ state ) { if ( ! in_array ( $ state , $ this -> config [ 'states' ] ) ) { throw new SMException ( sprintf ( 'Cannot set the state to "%s" to object "%s" with graph %s because it is not pre-defined.' , $ state , get_class ( $ this -> object ) , $ this -> config [ 'graph' ] ) ) ; } $ accessor = new PropertyAccessor ( ) ; $ accessor -> setValue ( $ this -> object , $ this -> config [ 'property_path' ] , $ state ) ; }
Set a new state to the underlying object

@param string $state

@throws SMException
Set a new state to the underlying object