Adds JSON string with JS settings
@param string $key
@param mixed $data
@param integer|null $weight
488433
public function setJsSettings($key, $data, $weight = null)
    {
        $asset = array(
            'type' => 'js',
            'weight' => $weight,
            'key' => 'js_settings',
            'merge' => 'js_settings',
            'asset' => array($key => $data)
        );

        $this->asset->set($asset);
    }
329279
public function addParameter($key, $data)
    {
        if (!is_string($key)) {
            throw new \RuntimeException('Only strings can be given as parameter keys. Got "' . gettype($key) . '".');
        }

        if (!is_string($data) && !is_callable($data)) {
            throw new \RuntimeException('The "data" parameter must either be a string or a callable. . Got "' . gettype($key) . '".');
        }

        if (isset($this->parameters[$key])) {
            throw new \RuntimeException('The parameter key "' . $key . '" is already set.');
        }

        $this->parameters[$key] = $data;

        return $this;
    }
1358931
public void setData(String key, Object value) {
        this.data = this.data.addData(key, value);
    }
781756
protected function addToRegistry($data, string $key = null)
    {
        is_null($key) and $key = get_class($data);
        $this->registry[$key] = $data;
    }
33027
public static function setValue($key, $value, &$data)
    {
        $parts = explode('.', $key);
        $first = array_shift($parts);
        if (count($parts) > 0) {
            $newKey = implode('.', $parts);
            if (!array_key_exists($first, $data)) {
                $data[$first] = array();
            }
            static::setValue($newKey, $value, $data[$first]);
            return;
        }
        $data[$first] = $value;
    }
616549
protected function setJavascriptData($key, $value = null)
    {
        if (is_array($key)) {
            JavaScriptFacade::put($key);
        } else {
            JavaScriptFacade::put([$key => $value]);
        }
    }
104
public void setData(String key, String value) {
        QName qn = new QName("data-" + key);
        this.getOtherAttributes().put(qn, value);
    }
716278
public static function add($key, $value) {

		if(null === $value && is_array($key)) {

			foreach($key as $index => $value) {
				static :: $data[$index] = $value;
			}

			return;
		}

		if(true === isset(static :: $data[$key]) && true === is_array(static :: $data[$key])) {

			if(true === is_array($value)) {
				$value = array_merge(static :: $data[$key], $value);	
			}
			else {
				static :: $data[$key][] = $value;
			}
		}

		static :: $data[$key] = $value;
	}
642053
public function save(array $data, $key)
    {
        $this->redis->set($this->decorateKey($key), $data);
    }
1307603
function(key, data) {
        var currentData;
        currentData = settings[key] || {};
        settings[key] = _.extend(currentData, data);
      }
676641
public JsonObject<V> addData(String key, Object value) {
        if (key == null) {
            return this;
        }
        if (this.data == null) {
            this.data = new HashMap<String, Object>();
        }
        this.data.put(key, value);
        return this;
    }
941850
public function appendData($key, $data)
    {
        $this->_putData($key, $data);

        if ($this->_objectCreation) {
            return $this->_afterAppendDataToNewObject();
        }
        return $this;
    }
115708
public function updatePreferences(string $key, $data)
    {
        $current = $this->preferences;

        $this->preferences = PreferencesParser::parse($current)->update($key, $data)->toJson();

        $this->save();
    }
700454
public static function insert($key, $data)
    {
        if (self::$configurator instanceof ConfiguratorClass) {
            return self::$configurator->insert($key, $data);
        } else {
            return null;
        }
    }
598049
public function set($key, $data) {
        if ($this->persist) {
            $this->store[$key] = $data;
        }
        return true;
    }
272977
function set($key, $data)
    {
        $this->cache[$key]         = $data;
        $this->cache_changes[$key] = true;
    }
484567
public function addWidgetData($key, $val)
    {
        if (!is_string($key)) {
            throw new InvalidArgumentException(
                'Setting key must be a string.'
            );
        }

        // Make sure default options are loaded.
        if ($this->widgetData === null) {
            $this->widgetData();
        }

        $this->widgetData[$key] = $val;

        return $this;
    }