Sets the value of a key.

@param string $key
@param mixed $value Can be any of serializable data type.

@return bool True if the set was successful, false if it was unsuccessful.

@throws \InvalidArgumentException
@throws InternalException
181073
public function set($key, $value)
    {
        Util::checkArgString($key);
        Util::checkArgSerializable($value);

        try {
            return $this->getAdapter()->set($key, $value);
        } catch (\Exception $e) {
            throw new InternalException($e->getMessage(), $e->getCode(), $e);
        }
    }
1355718
public function set($key, $value)
    {
        $setting = SettingModel::create(
            [
                'key' => $key,
                'value' => $value,
            ]
        );

        return $setting ? $value : false;
    }
267646
protected function internalSet($key, $value, $checkProperties = true): bool
    {
        if (
            $checkProperties === true
            &&
            $this->properties !== []
        ) {
            if (isset($this->properties[$key]) === false) {
                throw new \InvalidArgumentException('The key ' . $key . ' does not exists as @property in the class (' . \get_class($this) . ').');
            }

            $this->properties[$key]->checkType($value);
        }

        if ($key === null) {
            return false;
        }

        $this->generatorToArray();

        $array = &$this->array;

        if (
            $this->pathSeparator
            &&
            \is_string($key)
            &&
            \strpos($key, $this->pathSeparator) !== false
        ) {
            $path = \explode($this->pathSeparator, (string) $key);

            if ($path !== false) {
                // crawl through the keys
                while (\count($path, \COUNT_NORMAL) > 1) {
                    $key = \array_shift($path);

                    $array = &$array[$key];
                }

                $key = \array_shift($path);
            }
        }

        $array[$key] = $value;

        return true;
    }
112245
public function set($key, $value)
    {
        if (is_array($key) && $value === null)
            $args = $key;
        else
            $args = func_get_args();

        $value = array_pop($args);
        
        $parent = null;
        $key = null;
        $ref = &$this->values;
        foreach ($args as $arg)
        {
            if (!is_scalar($arg))
                throw new \InvalidArgumentException("Keys must be scalar, not: " . WF::str($arg));

            if (!is_array($ref))
            {
                if ($parent !== null)
                    $parent[$key] = array();
                $ref = &$parent[$key];
            }
                
            if (!isset($ref[$arg]))
                $ref[$arg] = array();

            $parent = &$ref;
            $key = $arg;
            $ref = &$ref[$arg];
        }

        // Unwrap Dictionary objects
        $cl = is_object($value) ? get_class($value) : null;
        if ($cl === Dictionary::class)
            $ref = $value->getAll();
        else
            $ref = $value;

        return $this;
    }
1093285
public function set($key, $value)
    {
        //argument test
        Argument::i()
            //Argument 1 must be a string
            ->test(1, 'string')
            //Argument 2 must be scalar or null
            ->test(2, 'scalar', 'null');
        
        if (is_null($value)) {
            $value = 'NULL';
        } else if (is_bool($value)) {
            $value = $value ? 'TRUE' : 'FALSE';
        }
        
        $this->set[$key] = $value;
        
        return $this;
    }
1162148
public function set($key, $value)
    {
        $this->nestedKeyCache = [];

        if ($this->isNestedKey($key)) {
            $this->setNestedValueByKey($key, $value);

            return;
        }

        $this->items[$key] = $value;
    }
466642
protected function _set($key, $value)
    {
        if (!is_string($key)) {
            throw new Exception\InvalidArgumentException(
                "Key must be a string or a number"
            );
        }
        $this->_viewVars[$key] = $value;
    }
182132
public function setData(string $key, $value): bool
    {
        if ($key !== 'password' || $key !== 'salt' || $key !== 'remember_md') {
            $this->data[$key] = $value;
            return true;
        } else {
            return false;
        }
    }
771687
public static function set($key, $value) {

		if(false === is_string($key)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
		}

		static :: $data[$key] = $value;
	}
365315
protected function set($key, $value)
    {
        if ($key === 'deleted') {
            throw new \InvalidArgumentException(
                '$key must not be "deleted". Please use setToDeleted() instead.',
                1331489276
            );
        }
        if ($this->isReadOnly()) {
            throw new \BadMethodCallException('set() must not be called on a read-only model.', 1331489292);
        }

        if ($this->isGhost()) {
            $this->load();
        }
        $this->data[$key] = $value;

        $this->markAsLoaded();
        $this->markAsDirty();
    }
954963
public function set($key, $value)
    {
        $array = &$this->data;
        $keys = explode(self::SEPERATOR, $key);
        $i = 1;
        foreach ($keys as $item) {
            if (is_array($array) && array_key_exists($item, $array) && !is_array($array[$item]) && $i !== count($keys)) {
                return false;
            }
            $array = &$array[$item];
            $i++;
        }
        $array = $value;
        $this->save();
        return true;
    }
1151340
public function set($key, $value)
    {
        $allowed = array_diff(array_keys(get_class_vars(get_class($this))), $this->_hidden);
        if (empty($allowed) || !empty($allowed) && in_array($key, $allowed)) {
            if (method_exists($this, 'set' . ucfirst($key))) {
                call_user_func_array([$this, 'set' . ucfirst($key)], [$value]);
            } else {
                $this->{$key} = self::modelize($key, $value);
            }
        }

        return $this;
    }
961836
public function set($key, $value)
    {
        if (is_null($value)) {
            $value = 'NULL';
        } else if (is_bool($value)) {
            $value = $value ? 'TRUE' : 'FALSE';
        }
        
        $this->set[$key] = $value;
        
        return $this;
    }
501239
public function setItem($key, $value)
    {
        if (!$this->getOptions()->getEnabled()) {
            return false;
        }

        $this->normalizeKey($key);

        $result = false;
        try {
            $result = $this->internalSetItem($key, $value);
        } catch (\Exception $e) {
        }

        return $result;
    }
1081731
public static function set(string $key, $value)
    {
        file_put_contents(self::determineDabaseFilePathFor($key), Json::encode($value));

        return $value;
    }
239617
public function put(string $key, $value): self
    {
        if (!is_scalar($value)) {
            throw new \InvalidArgumentException(
                    'Argument 2 passed to ' . __METHOD__
                    . ' must be an instance of a scalar value.'
            );
        }

        $this->headers[$key] = (string) $value;
        return $this;
    }
252432
final public static function set($key, $value)
	{
		self::_checkInstance();
		self::$_instance->offsetSet($key, $value);
	}