Store a value

@param string $group The name of the group
@param string $key The unique identifier for the value to store
@param mixed $value The value to store
@return \sndsgd\ArrayCache
506420
public function set(string $group, string $key, $value): ArrayCache
    {
        if ($group === "") {
            throw new \InvalidArgumentException(
                "invalid group provided; expecting a non empty string"
            );
        }

        if ($key === "") {
            throw new \InvalidArgumentException(
                "invalid key provided; expecting a non empty string"
            );
        }

        if ($value === null) {
            throw new \InvalidArgumentException(
                "invalid value provided; expecting anything but null"
            );
        }

        if (!isset($this->values[$group])) {
            $this->values[$group] = [];
        }

        $this->values[$group][$key] = $value;
        return $this;
    }
651744
public function save( $key, $value, $expire = 0 ) {
		$key = $this->get_key( $key );
		wp_cache_set( $key, $value, $this->group, $expire );
	}
723930
public function deleteByKey($key, $group = null) {
        $query = $this->model
            ->where('key', $key);

        if(! is_null($group))
            $query->where('group', $group);

        $setting = $query
            ->first();

        if( isset($setting->id) )
            $setting->delete();

        return $this;
    }
1087076
public function set($key, $value)
    {
        $this->store[$key] = $value;

        return setcookie($key, $value);
    }
141745
public static function set($key, $value) {
		$memcached = self::connect();
		$config = \Skeleton\Object\Config::$cache_handler_config;
		$memcached->add($key, $value, $config['expire']);
	}
20307
public function store($key, $value, $expiration = 0)
    {
        // $this->getTimeout(); Do delete based on the session time out
        $data = [
            'time'   => time(),
            'expire' => $expiration,
            'data'   => $value,
        ];

        if ($this->where == true) {
            $this->setCache($key)
                 ->setPath(CYGNITE_BASE.DS.toPath('public.storage.cache').DS);
        }

        if (is_array($this->getCache())) {
            $array = $this->getCache();
            $array[$key] = $data;
        } else {
            $array = [$key => $data];
        }

        $cacheData = json_encode($array);

        if ($this->getDirectory() == true) {
            @file_put_contents($this->getDirectory(), $cacheData);
        }

        return $this;
    }
974531
public function set($key, $value = null)
    {
        if ($key === null) {
            array_push($this->storage, $value);

            return $this;
        }

        if (is_array($key)) {
            foreach ($key as $key => $value) {
                $this->storage[$key] = $value;
            }

            return $this;
        }

        $this->setValueToStack($this->storage, explode(self::SEPARATOR, $key), $value);

        return $this;
    }
571303
public function set( $key, $value = null, $group = '' )
	{
		$this->checkLoaded();
		$this->modified = true;

		if ( is_array($key) ) {
			foreach ( $key as $k => $v ) {
				SettingsUtilities::set($this->storage, $k, $v);
			}
		} else {
			SettingsUtilities::set($this->storage, $key, $value);
		}
	}
1029777
public function insert($key, $value, $group = self::DEFAULT_GROUP) {
        return $this->update($key, $value, $group);
    }
403829
public function set($key, $value)
	{
		if ( !($value instanceof Option) &&
			!($value instanceof Optgroup) )
		{
			throw new \InvalidArgumentException('Only Options or Optgroups can be added to a Select.');
		}

		parent::set($key, $value);
		return $this;
	}
158798
public function setData($key, $value)
    {
        gplcart_array_set($this->data, $key, $value);
        return $this->data;
    }
1318259
public function update($key, $value, $group = self::DEFAULT_GROUP) {
        $this->repository->updateOrCreate($key, [
            'value' => $value,
            'group' => $group
        ]);

        return true;
    }
1162135
public function remove(string $group = "", string $key = ""): ArrayCache
    {
        $isGroupEmpty = ($group === "");
        $isKeyEmpty = ($key === "");

        if ($isGroupEmpty && !$isKeyEmpty) {
            throw new \LogicException(
                "removing a value by key is only possible when a group ".
                "is provided"
            );
        }

        if ($isKeyEmpty) {
            unset($this->values[$group]);
        } else {
            unset($this->values[$group][$key]);
        }

        return $this;
    }
71646
public function set($key, $value)
    {
        $registry = ArrayHelper::set($this->getItems(), $key, $value, $useDotSyntax = true);
        $this->setItems($registry);

        return $this->getItems();
    }
1235008
public static function &set(&$storage, $key, $value)
    {
        // temporary replacement for escaped dot.
        $key = str_replace("\.", "z#G1", $key);

        $keys = explode('.', $key);

        foreach($keys as $key)
        {
            $key = str_replace("z#G1", ".", $key);

            if(!isset($storage[$key]) || !is_array($storage[$key]))
                $storage[$key]	= array();

            $storage = &$storage[$key];

            $laststorage = &$storage;
        }

        $storage = $value;

        return $laststorage;
    }
353812
public function update($key, $value, $group = self::DEFAULT_GROUP) {
        $this->settings[$group][$key] = $value;

        return $this;
    }
184061
protected function makeRows($group, $key, $value): array
    {
        $rows = [];

        if (is_array($value)) {
            foreach ($value as $subKey => $subValue) {
                $rows[] = [
                    'key'   => $group . '.' . $key . '.' . $subKey,
                    'value' => $subValue,
                ];
            }
        } else {
            $rows[] = [
                'key'   => $group . '.' . $key,
                'value' => $value,
            ];
        }

        return $rows;
    }