Reset table state to new form.

@param State $state Use null to flush table schema.

@return self|$this
354420
public function setState(State $state = null): AbstractTable
    {
        $this->current = new State($this->initial->getName());

        if (!empty($state)) {
            $this->current->setName($state->getName());
            $this->current->syncState($state);
        }

        return $this;
    }
1122264
public function setState($state)
		{
		$r = array_pop($this->states);
		array_push($this->states, $state);
		$this->state = $this->states[count($this->states) - 1];
		return $r;
		}
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;
    }
185843
public function save($state)
	{
		$command=$this->db->createCommand();
		if(false===$this->exists())
			return $command->insert($this->stateTableName,array(
				$this->keyField=>Yii::app()->name,
				$this->valueField=>serialize($state)
			));
		else
			return $command->update($this->stateTableName,array($this->valueField=>serialize($state)),
				$this->db->quoteColumnName($this->keyField).'=:key',
				array(':key'=>Yii::app()->name)
		);
	}
632958
public function reset() {
		$this->tables  = [];
		$this->columns = [];
		$this->where   = [];
		$this->offset  = null;
		$this->limit   = null;
		$this->orderBy = [];
		$this->groupBy = [];
		$this->joins   = [];
		$this->params  = [];

		return $this;
	}
585608
private function resetState()
    {
        $this->state['helo'] = false;
        $this->state['mail'] = false;
        $this->state['rcpt'] = false;
    }
1150045
public function setRememberState($state = TRUE, $sectionName = NULL)
    {
        $this->getPresenter(); //component must be attached to presenter
        $this->getRememberSession(TRUE); //start session if not
        $this->rememberState = (bool) $state;
        $this->rememberStateSectionName = $sectionName;

        return $this;
    }
1265153
public function setState($state)
    {
        $this->complement['state'] = $state;
        $this->states['state'] = $state;
        $this->setStates();

        return $state;
    }
1223133
public function resetDQLPart($part)
    {
        $this->_dqlParts[$part] = is_array($this->_dqlParts[$part]) ? array() : null;
        $this->_state           = self::STATE_DIRTY;

        return $this;
    }
938734
public function restoreFormState()
    {
        // Restore messages
        $result = $this->getSessionValidationResult();
        if (isset($result)) {
            $this->loadMessagesFrom($result);
        }

        // load data in from previous submission upon error
        $data = $this->getSessionData();
        if (isset($data)) {
            $this->loadDataFrom($data, self::MERGE_AS_INTERNAL_VALUE);
        }
        return $this;
    }
214189
public function set_state($state) {
        if ($state <= $this->state) {
            return false;
        }
        $this->state = $state;
        return true;
    }
1029867
public function setSelected( $state ) {
		$this->selected = (bool)$state;
		if ( $this->selected ) {
			$this->input->setAttributes( [ 'checked' => 'checked' ] );
		} else {
			$this->input->removeAttributes( [ 'checked' ] );
		}
		return $this;
	}
1300834
public function setModelState($providerName, $modelId, $state)
    {
        if (!isset($this->states[$providerName])) {
            $this->states[$providerName] = [];
        }

        $this->states[$providerName][$modelId] = (bool) $state;

        return $this;
    }
752960
public function setRecordState($state)
    {
        if ($state != null) {
            $this->flush();
            $this->record = StringHelper::booleanValue($state);
        }
    }
1331977
public function setState(\Core\Entity\State $state = null)
    {
        $this->state = $state;

        return $this;
    }
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})");
    }