Back to Cache class

Method remove

public bool
remove
(mixed $id, mixed $group = null)
Remove a cached data entry by ID and group
Parameters
  • string $id The cache data ID
  • string $group The cache data group
Returns
  • bool
Since
  • 1.7.0
Class: Cache
Project: Joomla

Method remove - Source code

/**
 * Remove a cached data entry by ID and group
 *
 * @param   string  $id     The cache data ID
 * @param   string  $group  The cache data group
 *
 * @return  boolean
 *
 * @since   1.7.0
 */
public function remove($id, $group = null)
{
    // Get the default group
    $group = $group ?: $this->_options['defaultgroup'];
    try {
        return $this->_getStorage()->remove($id, $group);
    } catch (CacheExceptionInterface $e) {
        if (!$this->getCaching()) {
            return false;
        }
        throw $e;
    }
}