Get\Set Krumo state: whether it is enabled or disabled

@param boolean $state
@return boolean
18406
private static function _debug($state=null)
	{
		static $_ = true;

		// set
		//
		if (isset($state))
		{
			$_ = (boolean) $state;
		}

		// get
		//
		return $_;
	}
724527
public function toggleOptions($options, $state = null)
    {
        if ($state === null) {
            $state = ($this->options & $options) !== $options;
        }

        return $this->setOptions(
            $state ?
            $this->options | $options :
            $this->options & ~$options
        );
    }
402364
function setState($state) {
		if($state == (self::ALARM_ACTUATOR_STATE_ON or self::ALARM_ACTUATOR_STATE_OFF))
			$this->state = $state;
		else
			throw new \Exception('Invalid AlarmActuator state "'.$state.'"');
	}
194042
protected function isRedirectState($state)
	{
		$state = (int) $state;

		return $state > 299 && $state < 400 && array_key_exists($state, $this->responseMap);
	}
1005433
public static function get_StockState( &$state )
    {
        if( $state instanceof StockState or null === $state ) {
            $state = StockState::makeFromString( $state );
        }
        return $state;
    }
990628
public function any($state) : State
    {
        foreach (['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS'] as $verb) {
            $this->addCallback($verb, $state);
        }
        return $this;
    }
346719
protected function setBinaryState($state)
    {
        $service = $this->services['BridgeService']['serviceType'];
        $controlUrl = $this->services['BridgeService']['controlURL'];
        $method = 'SetBinaryState';
        $arguments = [
            'BinaryState' => $state
        ];

        $rs = $this->client->request($controlUrl, $service, $method, $arguments);
        if(!empty($rs)) {
            $rs = $this->unwrapResponse($rs);

            if (isset($rs['s:Fault'])) {
                throw new \Exception('Failed to change switch state. ' . print_r($rs, true));
            }

            return $rs;
        } else {
            $this->saveState($state);

            return true;
        }
    }
250969
function setState($state) {
		if($state == (self::GENERIC_ACTUATOR_STATE_ON or self::GENERIC_ACTUATOR_STATE_OFF))
			$this->state = $state;
		else
			throw new \Exception('Invalid GenericActuator state "'.$state.'"');
	}
1275306
public function setState($state) {
        $statusProp = $this->getProperty(OntologyDeliveryExecution::PROPERTY_STATUS);
        $state = $this->getResource($state);
        $currentStatus = $this->getState();
        if ($currentStatus->getUri() == $state->getUri()) {
            common_Logger::w('Delivery execution '.$this->getIdentifier().' already in state '.$state->getUri());
            return false;
        }
        $this->editPropertyValues($statusProp, $state);
        if ($state->getUri() == DeliveryExecutionInterface::STATE_FINISHED) {
            $this->setPropertyValue($this->getProperty(OntologyDeliveryExecution::PROPERTY_TIME_END), microtime());
        }
        $this->state = $state;
        return true;
    }
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;
    }
606741
public function reset($state = null)
    {
        if (empty($state)) {
            static $initalState = [];
            if (empty($initalState)) {
                $initalState = get_class_vars(__CLASS__);
            }
            $state = $initalState;
        }

        foreach ($state as $property => $value) {
            $this->{$property} = $value;
        }

        return true;
    }
885722
public function setState($state = null)
        {
            if (null === $state) {
                $this->_state = $state;
                return $this;
            }

            if (in_array($state, array(static::STATE_SUCCESS, static::STATE_ERROR, static::STATE_INFO))) {
                $this->_state = $state;
            }

            return $this;
        }
934679
public function set_enabled($newstate = true) {
        $enabled = self::get_enabled_plugins();
        if (array_key_exists($this->name, $enabled) == $newstate) {
            // Nothing to do.
            return;
        }
        if ($newstate) {
            // Enable converter plugin.
            $plugins = \core_plugin_manager::instance()->get_plugins_of_type('fileconverter');
            if (!array_key_exists($this->name, $plugins)) {
                // Can not be enabled.
                return;
            }
            $enabled[$this->name] = $this->name;
            self::set_enabled_plugins($enabled);
        } else {
            // Disable converter plugin.
            unset($enabled[$this->name]);
            self::set_enabled_plugins($enabled);
        }
    }
1194340
function setState($state) {
		if($state == (self::SWITCH_ACTUATOR_STATE_ON or self::SWITCH_ACTUATOR_STATE_OFF))
			$this->state = $state;
		else
			throw new \Exception('Invalid SwitchActuator state "'.$state.'"');
	}
1301538
protected function partial(bool $state = true)
    {
        $this->partial = $state;

        if ( ! $this->partial) {
            return;
        }

        $key = $this->getKey();

        if (false !== strpos($key, self::PARTIAL_UPLOAD_NAME_SEPARATOR)) {
            list($key, /* $partialKey */) = explode(self::PARTIAL_UPLOAD_NAME_SEPARATOR, $key);
        }

        $this->key = $key . uniqid(self::PARTIAL_UPLOAD_NAME_SEPARATOR);
    }
77412
public static boolean isEnabled(State state) {
    return Boolean
        .valueOf(state.getProp(ConfigurationKeys.METRICS_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_ENABLED));
  }
1313004
public function setState($state)
	{
		if ( $state == $this->getState() ) { return; }

		$this->_values['state'] = (string) $state;
		$this->setModified();
	}