Set a new state to the underlying object

@param string $state

@throws SMException
538
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);
    }
251343
public static function setValidationState( $state = true)
	{
		$previousState = XBRL::$validating;
		XBRL::$validating = $state;
		return $previousState;
	}
1205334
private function setBatchRequest($state)
    {
        $this->_connection->setBatchRequest($state);
        $this->_processed = true;

        return $this;
    }
1277681
protected function _addState($state)
    {
        if (!is_string($state) && !($state instanceof Stringable)) {
            throw $this->_createInvalidArgumentException(
                $this->__('Argument is not a valid state.'),
                null,
                null,
                $state
            );
        }

        $this->states[(string) $state] = $state;
    }
506246
public function replaceState(string $name, $state): self
    {
        $this->state[$name] = $state;
        return $this;
    }
866335
public function setState($state)
    {
        if (is_int($state)) { $state = self::getStates()[$state]; }
        $state = strtoupper($state);
        if (!in_array($state, self::getStates())) {
            throw new \InvalidArgumentException(sprintf('The "%s" state is not a valid state.', $state));
        }
        $this->state = $state;
        return $this;
    }
1087120
public function setState($state)
    {
        if (!empty($state) && is_string($state) && ctype_print($state)) {
            $this->state = trim($state);
        }

        return $this;
    }
125370
protected function initSchema(State $state)
    {
        parent::initSchema($state);

        //Reading table schema
        $this->engine = $this->driver->query('SHOW TABLE STATUS WHERE `Name` = ?', [
            $state->getName()
        ])->fetch()['Engine'];
    }
469151
public function setOverwrite($state = false)
	{
		$tmp = $this->overwrite;

		if ($state)
		{
			$this->overwrite = true;
		}
		else
		{
			$this->overwrite = false;
		}

		return $tmp;
	}
818671
public function setPlatformState(MaintenanceState $state)
    {
        if ($previous = $this->getDriver()->get(self::PREFIX . self::LAST_MODE)) {
            $currentState = new MaintenanceState(json_decode($previous, true));
            $currentState->setEndTime($state->getStartTime());
            $this->getDriver()->set(self::PREFIX . $currentState->getId(), json_encode($currentState->toArray()));

            $state->setId($currentState->getId() + 1);
        }


        $this->getDriver()->set(self::PREFIX . self::LAST_MODE, json_encode($state->toArray()));
    }
1084488
public function jumpToState($state)
    {
        if (!$state instanceof StateInterface) {
            $state = $this->getState($state);
        }

        if (!$this->canJumpToState($state)) {
            throw new StateException(sprintf('Can not jump from state "%s" to "%s".',$this->currentState->getName(), $state->getName()));
        }

        $this->object->setFiniteState($state->getName());
        $this->currentState = $state;
    }
670846
void addState(State<S, L> state) {
        ElementReference ref = states.referencedAdd(state);
        state.setBlockReference(ref);
        state.setBlock(this);
    }
1006485
function setState($state) {
		if($state == (self::SMOKE_DETECTOR_STATE_SMOKE_ALARM_ON or self::SMOKE_DETECTOR_STATE_SMOKE_ALARM_OFF))
			$this->state = $state;
		else
			throw new \Exception('Invalid SmokeDetectorSensor state "'.$state.'"');
	}
197484
protected function changeState($state)
    {
        $currState = $this->_poolClientState;
        //Save previous state
        if (isset($currState) && $currState !== PoolClientInterface::CLIENT_POOL_STATE_LOCKED) {
            $this->_poolClientStatePrev = $currState;
        }
        $this->_poolClientState = $state;
        $this->emit(PoolClientInterface::CLIENT_POOL_EVENT_CHANGE_STATE, [$state]);
    }
62347
public function set_state($state) {
        if ($state != $this->_state + 1 || $state > self::STATE_DONE) {
            throw new coding_exception('Invalid state passed to moodle_page::set_state. We are in state ' .
                    $this->_state . ' and state ' . $state . ' was requested.');
        }

        if ($state == self::STATE_PRINTING_HEADER) {
            $this->starting_output();
        }

        $this->_state = $state;
    }
868392
public function setState(StateInterface $state): StateManagerInterface
    {
        $this->collection->offsetSet($state->getIdentifier()->getId(), $state);
        
        return $this;
    }
437207
private void setState(State newState) {
        m_logger.debug("Entering state: {}", newState.toString());
        synchronized (m_stateChangeLock) {
            m_state = newState;
            m_stateChangeLock.notifyAll();
        }
    }