Set the value of a global variable.

@param string $variable (required) The variable to set
@param string $value The value to set the variable to
@throws InvalidParameterException
189221
public function setGlobalVar($variable, $value = null)
    {
        $uri = 'asterisk/variable';

        try {
            $this->client->getEndpoint()->post($uri, [
                'form_params' => [
                    'variable' => $variable,
                    'value' => $value
                ]
            ]);
        } catch (RequestException $e) {
            $this->processRequestException($e);
        }
    }
124175
public static function setGlobal($key, $value = null)
    {
        if (is_array($key))
        {
            foreach ($key as $key2 => $value)
            {
                self::$_globalData[$key2] = $value;
            }
        }
        else
        {
            self::$_globalData[$key] = $value;
        }
    }
550071
public function setParam($key, $value = null)
    {
        if (!$this->hasParam($key)) {
            throw new \InvalidArgumentException(sprintf('Cannot set %s as parameter cause this key does not exist.', $key));
        }

        if (is_object($value)) {
            throw new \InvalidArgumentException('Parameter\'s value cannot be type of object.');
        }

        $currentValue = $this->getParamValue($key);
        if (
            (null !== $value && null !== $currentValue)
            && (
                gettype($value) !== gettype($currentValue)
                && (
                    !(is_string($value) || is_integer($value))
                    || !(is_string($currentValue) || is_integer($currentValue))
                )
            )
        ) {
            throw new \InvalidArgumentException(sprintf(
                'Cannot replace %s\'s value, %s expected and %s given.',
                $key,
                gettype($currentValue),
                gettype($value)
            ));
        }

        if (null === $value) {
            unset($this->_parameters[$key]);
        } else {
            $this->_parameters[$key] = ['value' => $value];
        }

        return $this->getContentInstance();
    }
44226
public function setParamVariable($paramVariable)
    {
        if (is_bool($paramVariable) === true) {
            $this->paramVariable = $paramVariable;
        } else {
            $msg = "The 'paramVariable' argument must be a boolean value, '" . gettype($paramVariable) . "'.";
            throw new InvalidArgumentException($msg);
        }
    }
655867
public function setNumber($value)
    {
        $name = $this->getName();
        $this->setCallerIdVariable('num', $value);
        $this->setCallerIdVariable('all', "$name<$value>");
    }
1183006
protected function setValue($value)
    {
        if (!$this->validate($value)) {
            throw new \InvalidArgumentException(sprintf('%s is not a valid value', $value));
        }

        $this->value = $value;
    }
1134008
public function set($name, $value)
    {
        if ($name == 'id') {
            throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
        }
        $this->_states[$name] = $value;
        $this->save();
    }
172320
public function set($variable, $value = null)
    {
        if (is_array($variable)) {
            $this->userData = array_merge($this->userData, $variable);
        } else if (is_object($variable)) {
            $this->userData = array_merge($this->userData, (array)$variable);
        } else {
            if ($value === null) {
                unset($this->userData[$variable]);
            } else {
                $this->userData[$variable] = $value;
            }
        }
    }
1162019
public function setValue($value) {
		if (!$this->isPrimitive($value)) {
			throw new \InvalidArgumentException('Use setValue() only for primitives and PhpConstant, anyway use setExpression() instead.');
		}
		$this->value = $value;
		$this->hasValue = true;

		return $this;
	}
1251309
private function set_global_variable()
    {
        $var_name = "";
        
        if( null != $this->config->global_variable )
        {
            $var_name = $this->config->global_variable;
        }
        else
        {
            $var_name = $this->page->get_slug().'_options';
        }
        
        $GLOBALS[$var_name] = $this->options->get();
    }
412577
public function assign($var, $value = null)
    {
        if (is_string($var)) {
            $this->$var = $value;
        } elseif (is_array($var)) {
            foreach ($var as $key => $value) {
                $this->$key = $value;
            }
        }
    }
614083
public function setParameter($parameter, $value)
    {
        if (is_bool($value)) {
            $value = $value ? '1' : '0';
        }

        $this->parameters[$parameter] = $value;
    }
1283925
function set($var, $value)
    {
        if (in_array($var, get_object_vars($this)))
        {
            $this->$var = $value;
        }
        else
        {
            Error::info(__FUNCTION__, $var . " does not belong to PB_Page!");
        }
    }
485782
public function set($name, $value = null)
    {
        if (!is_array($name)) {
            $name = [$name => $value];
        }

        foreach ($name as $name => $value) {
            $name = self::normalizeName($name);
            $value = self::normalizeValue($value);

            $this->parameters[$name] = $value;
        }
    }
653940
public function setVariable($key, $value)
    {
        $key = (string) $key;
        $this->currentRequest->variables->$key = $value;
        return true;
    }
1203661
public function setValue($value)
	{
		// set default
		if( $value === "" )
		{
			$value = $this->value;
		}

		if( $this->type === "boolean" )
		{
			$value = is_bool($value) ? $value : in_array($value, ['y', 'yes', 'on', '1']);
		}
		else if( $this->type === "number" )
		{
			if( ! is_numeric($value) )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " must be a number");
			}
			$value = (float) $value;
			if( $this->required && $value === 0 )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " is required");
			}
		}
		else if( $this->type === "enum" )
		{
			if( ! in_array($value, $this->enum, true) )
			{
				$variant = "'" . implode("' or '", $this->enum) . "'";
				throw new \InvalidArgumentException($this->getTheTitle() . " must be equal " . $variant);
			}
		}
		else
		{
			$value = trim($value);
			if( $this->required && ! strlen($value) )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " is required");
			}
		}

		if( $this->type_of )
		{
			$value = call_user_func($this->type_of, $value);
			if( $value === false && $this->type !== "boolean" )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " value is invalid");
			}
		}

		$this->value = $value;
		return $this;
	}
902383
public function setTemperatureUnits($value)
    {
        if (!TemperatureUnit::getIsValid($value)) {
            throw new InvalidConfigException('Unknown "temperatureUnits" value');
        }
        $this->options['temperatureUnits'] = new JsExpression($value);
    }