public function changeState($state)
    {
        $availableStates = $this->dbObject('Status')->enumValues();
        if (in_array($state, $availableStates)) {
            $this->Status = $state;
            return true;
        } else {
            user_error(_t('Reservation.STATE_CHANGE_ERROR', 'Selected state is not available'));
            return false;
        }
    }
public function changeState($state)
    {
        $availableStates = $this->dbObject('Status')->enumValues();
        if (in_array($state, $availableStates)) {
            $this->Status = $state;
            return true;
        } else {
            user_error(_t('Reservation.STATE_CHANGE_ERROR', 'Selected state is not available'));
            return false;
        }
    }
public function changeState ( $ state ) { $ availableStates = $ this -> dbObject ( 'Status' ) -> enumValues ( ) ; if ( in_array ( $ state , $ availableStates ) ) { $ this -> Status = $ state ; return true ; } else { user_error ( _t ( 'Reservation.STATE_CHANGE_ERROR' , 'Selected state is not available' ) ) ; return false ; } }
Safely change to a state
todo check if state direction matches

@param $state

@return boolean
Safely change to a state todo check if state direction matches