Set the read-only state of the widget. This should probably change the widget's appearance and
prevent it from being used.

@param bool $state Make input read-only
@return $this
6193
public function setReadOnly( $state ) {
		$this->readOnly = (bool)$state;
		if ( $this->readOnly ) {
			$this->input->setAttributes( [ 'readonly' => 'readonly' ] );
		} else {
			$this->input->removeAttributes( [ 'readonly' ] );
		}
		return $this;
	}
496022
public function setCheck($check, $state)
    {
        if (array_key_exists($check, $this->meta->checks))
        {
            $this->meta->checks[$check] = $state;
        }
    }
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.'"');
	}
649899
public function setState($state)
    {
        if (!in_array($state, $this->validStates)) {
            throw new InvalidArgumentException("Invalid editor state: $state");
        }

        $this->state = $state;

        $this->session->put($this->statePersistenceKey, $state);

        return $this;
    }
867195
public function setState(?string $state): Webhook
    {
        if (null !== $state) {
            Assert::oneOf($state, self::VALID_STATES);

            $this->state = $state;
        }

        return $this;
    }
140720
public static function activate_state($state)
    {
        foreach (self::variants() as $variant => $instance) {
            if (isset($state[$variant]) && $instance->appliesToEnvironment()) {
                $instance->activateState($state[$variant]);
            }
        }
    }
881588
public function process( BootstrapState $state ) {
		$commands        = $this->get_protected_commands();
		$current_command = $this->get_current_command();

		foreach ( $commands as $command ) {
			if ( 0 === strpos( $current_command, $command ) ) {
				$state->setValue( BootstrapState::IS_PROTECTED_COMMAND, true );
			}
		}

		return $state;
	}
553984
public function setState(int $state)
    {
        if ($state < 0 || $state > 2) {
            Throw new UserException('Users state value can be 0 (active), 1 (awaits activation by mail) or 2 (awaits activation by admin)');
        }

        $this->state = $state;
    }
354866
public function setAutocomplete(string $state = 'on'): Form
    {
        $states = [
            'on',
            'off'
        ];

        if (!in_array(strtolower($state), $states))
            Throw new FormException('Wrong html form autocomplete attribute state.', 1000);

        $this->attribute['autocomplete'] = $state;

        return $this;
    }
868180
protected function _setState($state)
    {
        if ($state !== null && !($state instanceof MapInterface)) {
            throw $this->_createInvalidArgumentException(
                $this->__('Argument is not a valid map'), null, null, $state
            );
        }

        $this->state = $state;
    }
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.'"');
	}
6009
public final function enable($state = true){

		$old_state = $this->_enabled;

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

		return $old_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;
	}
947738
public function setState($state)
    {
        $oldState = $this->getState();

        if ($oldState === $state) {
            return $this;
        }

        $this->getLogger()->debug('Changing state from: '.$oldState.' to: '.$state.'.');
        $this->state = $state;

        return $this;
    }
214189
public function set_state($state) {
        if ($state <= $this->state) {
            return false;
        }
        $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;
    }
925766
public function set_excluded($state) {
        if (empty($this->excluded) and $state) {
            $this->excluded = time();
            $this->update();
            return true;

        } else if (!empty($this->excluded) and !$state) {
            $this->excluded = 0;
            $this->update();
            return true;
        }
        return false;
    }