Back to Cache class

Method clean

public bool
clean
(mixed $group = null, mixed $mode = 'group')
Clean cache for a group given a mode.
Parameters
  • string $group The cache data group
  • string $mode The mode for cleaning cache [group|notgroup]
Returns
  • bool True on success, false otherwise
Since
  • 1.7.0
Class: Cache
Project: Joomla

Method clean - Source code

/**
 * Clean cache for a group given a mode.
 *
 * group mode    : cleans all cache in the group
 * notgroup mode : cleans all cache not in the group
 *
 * @param   string  $group  The cache data group
 * @param   string  $mode   The mode for cleaning cache [group|notgroup]
 *
 * @return  boolean  True on success, false otherwise
 *
 * @since   1.7.0
 */
public function clean($group = null, $mode = 'group')
{
    // Get the default group
    $group = $group ?: $this->_options['defaultgroup'];
    try {
        return $this->_getStorage()->clean($group, $mode);
    } catch (CacheExceptionInterface $e) {
        if (!$this->getCaching()) {
            return false;
        }
        throw $e;
    }
}