lithium\storage\Cache::clear PHP Method

clear() public static method

Clears entire cache by flushing it. All cache keys - *without* honoring a configured scope - from the specified configuration are removed.
public static clear ( string $name ) : boolean
$name string The cache configuration to be cleared.
return boolean `true` on successful clearing, `false` if failed partially or entirely.
    public static function clear($name)
    {
        try {
            return static::adapter($name)->clear();
        } catch (ConfigException $e) {
            return false;
        }
    }

Usage Example

 public function testClear()
 {
     Cache::write($this->cachedName, 'foo', 'bar');
     Cache::write($this->cachedName, 'foobar', 'baz');
     Cache::clear($this->cachedName);
     $result = Cache::read($this->cachedName, 'foo');
     $this->assertNull($result);
     $result = Cache::read($this->cachedName, 'foobar');
     $this->assertNull($result);
 }
All Usage Examples Of lithium\storage\Cache::clear