@param string      $key
@param null|string $group

@return bool
180015
public static function delete($key, $group = NULL)
	{
		$result = FALSE;
		try {
			!self::classExists() or $result = self::instance($group)->delete($key);
		} catch (Cache_Exception $e) {
			self::exception($e);
		}

		return $result;
	}
756628
function group($group)
    {
        if (!empty($group))
        {
            self::sql_safe($group);
            $this->group = "group by $group";
        }
        else
        {
            $this->group = '';
        }
    }
891511
public function isEmpty($key = null) {
		$result = true;
		if ($key !== null) {
			if (is_object($this->data) && isset($this->data->{$key})) {
				$result = empty($this->data->{$key});
			} elseif (is_array($this->data) && isset($this->data[$key])) {
				$result = empty($this->data[$key]);
			} else {
				$result = true;
			}
		} else {
			$result = empty($this->data);
		}
		return $result;
	}
310413
public function setGroup($key, $checkLastModified = true)
    {
        $this->_groupKey = $key;
        if ($checkLastModified) {
            if (! $this->groupsConfigFile) {
                $this->groupsConfigFile = self::app()->groupsConfigPath;
            }
            if (is_file($this->groupsConfigFile)) {
                $gc = (require $this->groupsConfigFile);
                $keys = explode(',', $key);
                foreach ($keys as $key) {
                    if (!isset($gc[$key])) {
                        // this can happen if value is null
                        // which could be solved with array_filter
                        continue;
                    }

                    $this->_lastModified = self::getLastModified($gc[$key], $this->_lastModified);
                }
            }
        }
    }
316992
public static function getKeys($group)
    {
        self::loadKeys();
        self::$keys[$group] = isset(self::$keys[$group]) ? self::$keys[$group] : [];

        return self::$keys[$group];
    }
1332480
public String remove(String group, String key) {
		group = StrUtil.nullToEmpty(group).trim();
		writeLock.lock();
		try {
			final LinkedHashMap<String, String> valueMap = this.get(group);
			if (MapUtil.isNotEmpty(valueMap)) {
				return valueMap.remove(key);
			}
		} finally {
			writeLock.unlock();
		}
		return null;
	}
164078
public function hasErrors($key = NULL)
    {
        if ($key) {
            return isset($this[$key]);
        } else {
            if (count($this)) {
                return true;
            } else {
                return false;
            }
        }
    }
1219767
protected function doSet($key, $grouping, $value)
    {
        //  Check that it's a valid key/grouping pair
        if (!isset($this->notifications[$grouping]->options[$key])) {
            $this->setError($grouping . '/' . $key . ' is not a valid group/key pair.');
            return false;
        }

        // --------------------------------------------------------------------------

        $oDb = Factory::service('Database');
        $oDb->where('key', $key);
        $oDb->where('grouping', $grouping);
        if ($oDb->count_all_results($this->table)) {
            $oDb->where('grouping', $grouping);
            $oDb->where('key', $key);
            $oDb->set('value', json_encode($value));
            $oDb->update($this->table);
        } else {
            $oDb->set('grouping', $grouping);
            $oDb->set('key', $key);
            $oDb->set('value', json_encode($value));
            $oDb->insert($this->table);
        }
    }
1339593
public function has($key = null)
    {
        if ($key === null) {
            return $this->count() > 0;
        }

        $arr = &$this->getStackByReference($key);

        return is_array($arr) ? array_key_exists($key, $arr) : false;
    }
465878
public static function putKey($group, $key)
    {
        self::loadKeys();

        self::$keys[$group] = self::getKeys($group);

        if (!in_array($key, self::$keys[$group])) {
            self::$keys[$group][] = $key;
        }

        self::storeKeys();
    }
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;
    }
1223984
public function isValid($key = null)
    {
        if (parent::isValid()) {
            if ($key && parent::getKey() && parent::getKey() == $key) {
                return true;
            }
        }

        return false;
    }
506340
public function clean($group = null)
	{
		$hash = $this->options['hash'];

		$allinfo = $this->apcu ? apcu_cache_info() : apc_cache_info('user');

		foreach ($allinfo['cache_list'] as $key)
		{
			if (strpos($key['info'], $hash . '-cache-' . $group . '-') === 0) // xor $mode != 'group')
			{
				$this->apcu ? apcu_delete($key['info']) : apc_delete($key['info']);
			}
		}
		return true;
	}
1100502
public function delete($key, $group = self::DEFAULT_GROUP) {
        $this->repository
            ->deleteByKey($key, $group);

        return true;
    }
912413
public Boolean getBool(String key, String group) {
		return getBool(key, group, null);
	}
402242
public function has(string $key = null) : bool
    {
        if ($key === null) {
            return false;
        }

        return $this->offsetExists($key);
    }
65692
public function isDescendant($group = null) {
    if (is_numeric($group)) {
      $group = Group::factory((int) $group);
    }
    if (!isset($group->guid)) {
      return false;
    }
    // Check to see if the group is a descendant of the given group.
    if (!isset($this->parent)) {
      return false;
    }
    if ($this->parent->is($group)) {
      return true;
    }
    if ($this->parent->isDescendant($group)) {
      return true;
    }
    return false;
  }