Change client state helper
@param int $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]);
    }
422840
public function setState(int $state): ControllerInterface
    {
        switch ($state) {
            case self::STATE_PLAYING:
                return $this->play();
            case self::STATE_PAUSED:
                return $this->pause();
            case self::STATE_STOPPED:
                return $this->pause();
        }
        throw new \InvalidArgumentException("Unknown state: {$state})");
    }
842593
public function switchPinState($post)
    {
        $post->setPinned(!$post->isPinned());
        $this->om->persist($post);
        $this->om->flush();
    }
904420
public function updateQueueState(int $state)
    {
        if ($this->isQueueable()) {
            $this->getInstance()
                ->getConnection()
                ->table($this->getInstance()->getTable())
                ->where($this->getInstance()->getQualifiedKeyName(), $this->getInstance()->getKey())
                ->update([
                    "{$this->name}_queue_state" => $state,
                ]);
        }
    }
948988
public function setRequired( $state ) {
		$this->required = (bool)$state;
		if ( $this->required ) {
			$this->input->setAttributes( [ 'required' => 'required', 'aria-required' => 'true' ] );
			if ( $this->getIndicator() === null ) {
				$this->setIndicator( 'required' );
			}
		} else {
			$this->input->removeAttributes( [ 'required', 'aria-required' ] );
			if ( $this->getIndicator() === 'required' ) {
				$this->setIndicator( null );
			}
		}
		return $this;
	}
438493
public static function set_StockState( $state )
    {
        if( $state instanceof StockState or null === $state ) {
            $state = StockState::makeFromString( $state );
        }
        return $state;
    }
199653
public function addState($state)
    {
        $this->_states[$state] = $state;

        if ($this->_currentState === null) {
            $this->_currentState = $state;
        }
    }
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()));
    }
884565
def state(self, state):
        ''''''
        logger.debug('client changing to state=%s', ClientState.Names[state])
        self._state = state
592282
public function setState(\Haven\PersonaBundle\Entity\State $state = null)
    {
        $this->state = $state;
    
        return $this;
    }
1331977
public function setState(\Core\Entity\State $state = null)
    {
        $this->state = $state;

        return $this;
    }
268506
private function makeCallable($state) : callable
    {
        if (is_callable($state)) {
            return $state;
        }
        return function () use ($state) {
            if (is_string($state) && class_exists($state)) {
                $state = new $state;
            }
            return $state;
        };
    }
6009
public final function enable($state = true){

		$old_state = $this->_enabled;

		$this->_enabled = (bool) $state;

		return $old_state;
	}
1333092
public function removeAuthContextClassRefWithPrefix(&$state)
    {
        $conf = Configuration::getConfig(self::CONFIG_FILE_NAME);
        $prefix = $conf->getString(self::PROPNAME_PREFIX, null);

        if (is_null($prefix)) {
            return;
        }
        unset($state['saml:RequestedAuthnContext']['AuthnContextClassRef']);
        $array = array();
        foreach ($this->authnContextClassRef as $value) {
            if (!(substr($value, 0, strlen($prefix)) === $prefix)) {
                array_push($array, $value);
            }
        }
        if (!empty($array)) {
            $state['saml:RequestedAuthnContext']['AuthnContextClassRef']
                = $array;
        }
    }
1178931
protected function setState($state)
    {
        if (!array_key_exists($state, $this->stateDirectives)) {
            throw new InvalidArgumentException("Invalid state {$state}");
        }
        $this->state = $state;
        return $this;
    }
542266
public function setState($state=0, $ids=array())
	{
		if (count($ids) <= 0)
		{
			return false;
		}

		$ids = array_map('intval', $ids);

		return $this->update()
			->set(array('state' => $state))
			->whereIn('id', $ids)
			->execute();
	}
1133295
public function setPushModelSupport($state) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');

        $this->pushModelSupport = (bool) $state;

        foreach ($this->nestedTiles as $tile) {
            if ($tile && $tile->isPushModelSupport()===null) {
                $tile->setPushModelSupport($state);
            }
        }
        return $this;
    }