Set entity StockState
@param StockState $state
@return StockState
438493
public static function set_StockState( $state )
    {
        if( $state instanceof StockState or null === $state ) {
            $state = StockState::makeFromString( $state );
        }
        return $state;
    }
1204471
protected function initSchema(State $state)
    {
        foreach ($this->fetchColumns() as $column) {
            $state->registerColumn($column);
        }

        foreach ($this->fetchIndexes() as $index) {
            $state->registerIndex($index);
        }

        foreach ($this->fetchReferences() as $foreign) {
            $state->registerForeignKey($foreign);
        }

        $state->setPrimaryKeys($this->fetchPrimaryKeys());

        //DBMS specific initialization can be placed here
    }
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;
    }
6193
public function setReadOnly( $state ) {
		$this->readOnly = (bool)$state;
		if ( $this->readOnly ) {
			$this->input->setAttributes( [ 'readonly' => 'readonly' ] );
		} else {
			$this->input->removeAttributes( [ 'readonly' ] );
		}
		return $this;
	}
851914
public function setUserState(\Sopinet\ChatBundle\Entity\UserState $userState = null)
    {
        $this->userState = $userState;

        return $this;
    }
697503
private function setOrderState($order, $state)
    {
        $prevState = $order->getState();
        if ($state == OrderModel::STATE_HOLDED) {
            // Ensure order is in one of the "can hold" states [STATE_NEW | STATE_PROCESSING]
            // to avoid no state on admin order unhold
            if ($prevState != OrderModel::STATE_NEW) {
                $order->setState(OrderModel::STATE_PROCESSING);
                $order->setStatus($order->getConfig()->getStateDefaultStatus(OrderModel::STATE_PROCESSING));
            }
            try {
                $order->hold();
            } catch (\Exception $e) {
                // Put the order in "on hold" state even if the previous call fails
                $order->setState(OrderModel::STATE_HOLDED);
                $order->setStatus($order->getConfig()->getStateDefaultStatus(OrderModel::STATE_HOLDED));
            }
        } elseif ($state == OrderModel::STATE_CANCELED) {
            try {
                $order->cancel();
                $order->setState(OrderModel::STATE_CANCELED);
                $order->setStatus($order->getConfig()->getStateDefaultStatus(OrderModel::STATE_CANCELED));
            } catch (\Exception $e) {
                // Put the order in "canceled" state even if the previous call fails
                $order->setState(OrderModel::STATE_CANCELED);
                $order->setStatus($order->getConfig()->getStateDefaultStatus(OrderModel::STATE_CANCELED));
            }
        } else {
            $order->setState($state);
            $order->setStatus($order->getConfig()->getStateDefaultStatus($state));
        }
    }
214189
public function set_state($state) {
        if ($state <= $this->state) {
            return false;
        }
        $this->state = $state;
        return true;
    }
868392
public function setState(StateInterface $state): StateManagerInterface
    {
        $this->collection->offsetSet($state->getIdentifier()->getId(), $state);
        
        return $this;
    }
1310776
public function setState($state)
    {
        if (!is_numeric($state)) {
            $errMsg = sprintf('Аргумент должен быть числом. Актуальное значение %s', $state);
            throw new ArgumentNotNumericException($errMsg);
        }
        $this->state = (integer)$state;

        return $this;
    }
714249
public function getState($state = null)
	{
		if ($state === null) {
			$state = $this->getValue();
		}

		if (!isset($this->states[$state])) {
			return 'default';
		}

		return $this->states[$state];
	}
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'];
    }
990628
public function any($state) : State
    {
        foreach (['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS'] as $verb) {
            $this->addCallback($verb, $state);
        }
        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;
    }
372637
private function setStates(array $states)
    {
        foreach ($states as $state) {
            if (!is_string($state) || strlen($state) !== 1) {
                throw new \InvalidArgumentException(
                    'State must be a one character string'
                );
            }
        }

        $this->states = $states;
    }
131271
private function setStates(array $states)
    {
        if (empty($states)) {
            throw new \InvalidArgumentException(
                'You must provide cat states'
            );
        }

        $height = count($states[0]);
        $width = 0;

        foreach ($states as $state) {
            if (!is_array($state)) {
                throw new \InvalidArgumentException(
                    'States must be an array of strings'
                );
            }

            if (count($state) !== $height) {
                throw new \InvalidArgumentException(
                    'Height must be the same for all states'
                );
            }

            foreach ($state as $line) {
                if (!is_string($line)) {
                    throw new \InvalidArgumentException(
                        'States must be an array of strings'
                    );
                }

                $width = max($width, strlen($line));
            }
        }

        $this->states = $states;
        $this->width = $width;
        $this->height = $height;
    }
153716
public function addState(\Haven\PersonaBundle\Entity\State $states)
    {
        $this->states[] = $states;

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