Removes settings

@param string $category Category name
@param array|string|null $key Setting key, keys array or null to delete all settings from category
@throws Exception
350785
public function remove($category, $key = null)
    {
        if ($key === null) {
            $this->dbDelete($category);

            if (isset($this->items[$category])) {
                unset($this->items[$category]);
            }
        }

        if (is_string($key)) {
            $this->dbDelete($category, $key);

            if (isset($this->items[$category][$key])) {
                unset($this->items[$category][$key]);
            }
        }

        if (is_array($key)) {
            foreach ($key as $idx => $val) {
                $this->remove($category, $key);
            }
        }

    }
799877
public function removeCategory($category)
	{
		if (!is_string($category))
		{
			// @codeCoverageIgnoreStart
			throw new \LogicException('Category must be of a type "string"');
			// @codeCoverageIgnoreEnd
		}
		if (isset($this->categories[$category]))
		{
			unset($this->categories[$category]);
		}

		return $this;
	}
904103
public function remove($key)
    {
        $keys = explode('.', $key);
        $section = &$this->items;

        while (count($keys) > 1) {
            $key = array_shift($keys);

            if (! isset($section[$key])) {
                return;
            }

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

        unset($section[array_shift($keys)]);

        $this->notify();
    }
877917
public function offsetUnset( $key )
	{
		if( !isset( $this->____pairs ) )
			$this->getPairs();
		if( !array_key_exists( $key, $this->____pairs ) )
			throw new Exception( 'Pair Key "'.$key.'" is not set in Row.' );
		unset( $this->____pairs[$key] );
	}
1127488
public static function delete($key)
    {
        // Check key existence
        if (!self::check($key)) {
            throw new \Exception('Configuration key "' . $key . '" doesn\'t exists');
            return false;
        }
        // Delete key and value
        unset(self::$configList[$key]);
        return true;
    }
536673
public void removeAppSetting(String key) {
		if (!StringUtils.isBlank(key)) {
			invokeDelete(Utils.formatMessage("_settings/{0}", key), null);
		}
	}
891117
def delete_category(self, category):
        """"""
        # Remove mapping of metrics-to-category
        category_key = self._category_key(category)
        self.r.delete(category_key)

        # Remove category from Set
        self.r.srem(self._categories_key, category)
1306645
public function endProfile(string $token, string $category = 'application'): void
    {
        $this->getProfiler()->end($token, ['category' => $category]);
    }
13067
public function forget($key)
    {
        $keyExp = explode('.', $key);

        // get settings value by first key name
        $query = $this->database
            ->table($this->config['db_table'])
            ->where('setting_key', $keyExp[0]);

        $row = $query->first(['setting_value']);

        if ( ! is_null($row))
        {
            if (count($keyExp) > 1)
            {
                // if found more keys, then forget last key from array
                $setting_value = json_decode($row->setting_value, true);

                unset($keyExp[0]);
                $newKey = implode('.', $keyExp);

                Arr::forget($setting_value, $newKey);


                if (count($setting_value) > 0)
                {
                    // if we still have settings, update settings row
                    $query->update(['setting_value' => json_encode($setting_value)]);
                }
                else
                {
                    // if settings value remain blank, delete settings row
                    $query->delete();
                }
            }
            else
            {
                // if found only one key, delete settings row
                $query->delete();
            }
        }

        $this->cache->forget($key);
    }
903594
public function setCategory(array $category)
    {
        $categoryClassInstance = new Category();
        foreach ($category as $categoryInstance) {
            Validate::isInstanceOf(
                $categoryInstance,
                $categoryClassInstance,
                'category'
            );
        }
        $this->category = $category;
    }
26080
public void onClearCategories(List<String> categories) {

        if (categories != null) {
            m_galleryDialog.getCategoriesTab().uncheckCategories(categories);
        }
    }
22821
public function remove($key)
    {
        if (array_key_exists($key, $this->settings)) {
            unset($this->settings[$key]);
            return true;
        }
        return false;
    }
1028801
public function del($key, $subKey = null)
    {
        if (!is_null($subKey) && (is_array($this->data[$key]))) {
            unset($this->data[$key][$subKey]);
        } else {
            unset($this->data[$key]);
        }
    }
1164618
def remove_category(*categories)
      categories.each do |category|
        direct_category_items.where(category_id: category).destroy_all
      end
      @categories = nil
    end
1042690
public function forget($key)
    {
        list($baseKey, $searchKey) = $this->fetchKey($key);

        $registry = $this->get($baseKey);

        if ($registry === null) {
            $registry = $this->cache->get($baseKey);
        }

        if (is_null($registry)) {
            throw new Exception("Item [$key] does not exists");
        }

        if ($baseKey !== $searchKey)
        {
            array_forget($registry, $searchKey);
            $this->database->table($this->config['table'])->where('key', '=', $baseKey)->update(array('value' => json_encode($registry)));

            // Update cache
            $this->cache->add($baseKey, $registry);
        }
        else
        {
            $this->database->table($this->config['table'])->where('key', '=', $baseKey)->delete();

            // Remove from cache
            $this->cache->remove($baseKey);
        }

        return true;
    }
1202620
public function destroy(Category $category)
    {
        if ($category->isRoot()) {
            abort(404);
        }

        if ($category->articles()->count()) {
            return $this->notifyError(trans('cms::categories.destroy.error'));
        }

        $category->delete();

        return $this->notifySuccess(trans('cms::categories.destroy.success'));
    }
994662
public function setCategories($categories)
    {
        foreach ($categories as $key => $name) {
            $this->_categories[$key] = $name;
        }
    }